Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cherry-pick): account for the word commit in commit message #2974

Merged
merged 1 commit into from
Jun 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions build/cherry-pick.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ let targetVersion = releaseType === 'patch' ? version : `${major}.${minor}.0`;
// get all commits from a branch
function getCommits(branch) {
const stdout = execSync(`git log ${branch || ''} --abbrev-commit`).toString();
const allCommits = stdout.split('commit ').filter(commit => !!commit);
const allCommits = stdout
.split(/commit (?=[\w\d]{8}[\n\r])/)
.filter(commit => !!commit);

// parse commits
const commits = [];
Expand Down Expand Up @@ -93,7 +95,8 @@ function getCommits(branch) {
// filter merge commits and any types that don't match the release type
if (
!merge &&
subject && !subject.startsWith('merge branch') &&
subject &&
!subject.startsWith('merge branch') &&
scope !== 'release' &&
commitType[releaseType] &&
!ignoreCommits.includes(hash)
Expand Down