Skip to content

Commit

Permalink
fix(cherry-pick-bot): allow forward slash in branch name (#4854)
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalArevalo authored Jan 4, 2023
1 parent 56c391b commit 59f7788
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cherry-pick-bot/src/cherry-pick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface Commit {
sha: string;
}

const COMMENT_REGEX = /^\/cherry-pick\s+(?<branch>\w[.-\w]*)/;
const COMMENT_REGEX = /^\/cherry-pick\s+(?<branch>\w[./-\w]*)/;

/**
* Parse a comment string to see if it matches the expected cherry-pick
Expand Down
5 changes: 5 additions & 0 deletions packages/cherry-pick-bot/test/cherry-pick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ describe('parseCherryPickComment', () => {
const branch = parseCherryPickComment('\n/cherry-pick 2.1.x ');
assert.strictEqual(branch, '2.1.x');
});

it('handles forward slash format', () => {
const branch = parseCherryPickComment('\n/cherry-pick release/2.1.x ');
assert.strictEqual(branch, 'release/2.1.x');
});
});

describe('cherryPickCommits', () => {
Expand Down

0 comments on commit 59f7788

Please sign in to comment.