Skip to content

docs: Create text.txt #10

docs: Create text.txt

docs: Create text.txt #10

Workflow file for this run

name: Commit Message Check
on:
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
commit-message-check:
runs-on: ubuntu-latest
steps:
- name: Check Out Code
uses: actions/checkout@v2 # This step checks out your Git repository
- name: Check Commit Message
id: check-commit-message
run: |
COMMIT_MESSAGE=$(git log --format=%s -n 1 $GITHUB_SHA)
ALLOWED_PREFIXES=("feat!" "feat" "fix" "patch" "chore" "build" "debug" "refactor" "revert" "ci" "perf" "style" "test" "docs" "wip")
VALID=false
for PREFIX in "${ALLOWED_PREFIXES[@]}"; do
if [[ $COMMIT_MESSAGE == "$PREFIX"* ]]; then
VALID=true
break
fi
done
if [[ $VALID == true ]]; then
echo "Commit message is valid."
exit 0
else
echo "Invalid commit message. Please use one of the allowed prefixes: ${ALLOWED_PREFIXES[*]}"
exit 1
fi