Skip to content

Commit 95481a3

Browse files
authored
change: accept github revert PR name [DEVOP-263] (#101)
1 parent 619befc commit 95481a3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/pullRequest.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
function isPullRequestTitleValid(pullRequestName) {
2-
return !!pullRequestName.match(
3-
/^(feat|fix|chore|docs|refactor|test|revert|build|ci|perf|style|change|remove|poc)(?:\(.+\))?!?:.+/
2+
return (
3+
!!pullRequestName.match(
4+
/^(feat|fix|chore|docs|refactor|test|revert|build|ci|perf|style|change|remove|poc)(?:\(.+\))?!?:.+/
5+
) || !!pullRequestName.match(/^revert .+/)
46
);
57
}
68

lib/pullRequest.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ describe("pull request", () => {
66
"fix(design-system): update color palette for accessibility compliance",
77
"feat!: send an email to the customer when a product is shipped",
88
"feat(api)!: send an email to the customer when a product is shipped",
9+
'revert "feat: add 3 freelance users " [PHP-539]',
910
])("Test pull request title %s should be valid", (title) => {
1011
expect(isPullRequestTitleValid(title)).toBe(true);
1112
});

0 commit comments

Comments
 (0)