feat: initial
All checks were successful
Test action / test-valid (push) Successful in 33s
Test action / test-invalid (push) Successful in 32s

This commit is contained in:
Maximilian Jugl 2026-04-21 15:35:01 +02:00
commit 6eed0afd4d
8 changed files with 339 additions and 0 deletions

28
action.yml Normal file
View file

@ -0,0 +1,28 @@
name: "Check conventional commit message"
description: "Checks if a value follows the conventional commit message specification."
inputs:
value:
description: "The value to test."
required: true
runs:
using: "composite"
steps:
- name: Check conventional commit message
shell: bash
env:
INPUT_VALUE: ${{ inputs.value }}
run: |
set -eo pipefail
CONVENTIONAL_COMMIT_REGEX='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([[:alnum:]._-]+\))?(!)?: .+'
printf 'Checking "%s"...\n' "$INPUT_VALUE"
if ! printf '%s\n' "$INPUT_VALUE" | grep -qE "$CONVENTIONAL_COMMIT_REGEX"; then
echo "::error title=Invalid Commit Message::Input '$INPUT_VALUE' is not a valid conventional commit message."
echo "Please refer to the specification: https://www.conventionalcommits.org/en/v1.0.0/"
exit 1
else
echo "::notice::Input is valid :)"
fi