feat: introduce allowed-commit-types input

This commit is contained in:
adrians5j 2023-11-23 22:25:05 +01:00
parent b1c8a44db3
commit 033d591e23

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.
// 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 ")) {