mirror of
https://github.com/webiny/action-conventional-commits.git
synced 2024-11-10 03:59:32 +01:00
feat: support ! for notifying breaking change
This commit is contained in:
parent
91c1d3f229
commit
0f9bb4c40c
2 changed files with 3 additions and 0 deletions
|
@ -2,6 +2,8 @@ import isValidCommitMessage from "../isValidCommitMesage";
|
|||
|
||||
test("should be able to correctly validate the commit message", () => {
|
||||
expect(isValidCommitMessage("chore(nice-one): doing this right")).toBe(true);
|
||||
expect(isValidCommitMessage("feat!: change all the things")).toBe(true);
|
||||
expect(isValidCommitMessage("fix(user)!: a fix with some breaking changes")).toBe(true);
|
||||
expect(isValidCommitMessage("fix: menu must open on shortcut press")).toBe(true);
|
||||
expect(isValidCommitMessage("something: should not work")).toBe(false);
|
||||
expect(isValidCommitMessage("fixes something")).toBe(false);
|
||||
|
|
|
@ -31,6 +31,7 @@ const isValidCommitMessage = (message, availableTypes = DEFAULT_COMMIT_TYPES): b
|
|||
|
||||
possiblyValidCommitType = possiblyValidCommitType
|
||||
.replace(/\s/g, "") // Remove all whitespace
|
||||
.replace(/\!/g, "") // Remove bang for notify breaking change
|
||||
.replace(/()/g, "") // Remove all whitespace
|
||||
.replace(/[^a-z]/g, ""); // Only leave [a-z] characters.
|
||||
|
||||
|
|
Loading…
Reference in a new issue