feat: introduce allowed-commit-types input

This commit is contained in:
adrians5j 2023-11-23 22:25:05 +01:00 committed by Adrian Smijulj
parent aa06c90208
commit 1d48a34279

View file

@ -1,4 +1,20 @@
const isValidCommitMessage = (message: string, availableTypes: string[]): boolean => { const DEFAULT_COMMIT_TYPES = [
"feat",
"fix",
"docs",
"style",
"refactor",
"test",
"build",
"perf",
"ci",
"chore",
"revert",
"merge",
"wip",
];
const isValidCommitMessage = (message: string, availableTypes = DEFAULT_COMMIT_TYPES): boolean => {
// Exceptions. // Exceptions.
// This is a message that's auto-generated by git. Can't do much about it unfortunately. Let's allow it. // 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 ") || message.startsWith("Revert ")) { if (message.startsWith("Merge ") || message.startsWith("Revert ")) {