mirror of
https://github.com/webiny/action-conventional-commits.git
synced 2024-11-10 12:09:34 +01:00
feat: allow "Merge " commit messages
This is a message that's auto-generated by git. Can't do much about it unfortunately. Let's allow it.
This commit is contained in:
parent
bfad0f127e
commit
646bcd692d
1 changed files with 7 additions and 0 deletions
|
@ -14,6 +14,13 @@ const DEFAULT_COMMIT_TYPES = [
|
||||||
];
|
];
|
||||||
|
|
||||||
const isValidCommitMessage = (message, availableTypes = DEFAULT_COMMIT_TYPES): boolean => {
|
const isValidCommitMessage = (message, availableTypes = DEFAULT_COMMIT_TYPES): boolean => {
|
||||||
|
// Exceptions.
|
||||||
|
// This is a message that's auto-generated by git. Can't do much about it unfortunately. Let's allow it.
|
||||||
|
if (message.startsWith('Merge ')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Commit message doesn't fall into the exceptions group. Let's do the validation.
|
||||||
let [possiblyValidCommitType] = message.split(":");
|
let [possiblyValidCommitType] = message.split(":");
|
||||||
possiblyValidCommitType = possiblyValidCommitType.toLowerCase();
|
possiblyValidCommitType = possiblyValidCommitType.toLowerCase();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue