Skip to content

Commit

Permalink
change
Browse files Browse the repository at this point in the history
  • Loading branch information
ccaulonque committed Jul 22, 2024
1 parent b2cd0a3 commit d6794e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/pullRequest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
function isPullRequestTitleValid(pullRequestName) {
return !!pullRequestName.match(
/^(feat|fix|chore|docs|refactor|test|revert|build|ci|perf|style|change|remove|poc)(?:\(.+\))?!?:.+/
return (
!!pullRequestName.match(
/^(feat|fix|chore|docs|refactor|test|revert|build|ci|perf|style|change|remove|poc)(?:\(.+\))?!?:.+/
) || !!pullRequestName.match(/^revert .+/)
);
}

Expand Down
1 change: 1 addition & 0 deletions lib/pullRequest.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ describe("pull request", () => {
"fix(design-system): update color palette for accessibility compliance",
"feat!: send an email to the customer when a product is shipped",
"feat(api)!: send an email to the customer when a product is shipped",
'revert "feat: add 3 freelance users " [PHP-539]',
])("Test pull request title %s should be valid", (title) => {
expect(isPullRequestTitleValid(title)).toBe(true);
});
Expand Down

0 comments on commit d6794e7

Please sign in to comment.