From 033d591e231b8e1f7a5e6e6a57a2c7eb13d2651f Mon Sep 17 00:00:00 2001 From: adrians5j Date: Thu, 23 Nov 2023 22:25:05 +0100 Subject: [PATCH] feat: introduce `allowed-commit-types` input --- src/isValidCommitMesage.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/isValidCommitMesage.ts b/src/isValidCommitMesage.ts index f192a4e..c9a8cd4 100644 --- a/src/isValidCommitMesage.ts +++ b/src/isValidCommitMesage.ts @@ -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 ")) {