feat: initial
This commit is contained in:
commit
6eed0afd4d
8 changed files with 339 additions and 0 deletions
28
action.yml
Normal file
28
action.yml
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue