Skip to content

feat: Create asdf.txt #11

feat: Create asdf.txt

feat: Create asdf.txt #11

Workflow file for this run

name: Commit Message Prefix Check
on:
pull_request:
types:
- opened
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check Commit Message Prefix
run: |
commit_message=$(git log --format=%B -n 1)
valid_prefixes=("feat!" "feat" "fix" "patch" "chore" "build" "debug" "refactor" "revert" "ci" "perf" "style" "test" "docs" "wip")
valid_commit=0
for prefix in "${valid_prefixes[@]}"; do
if [[ $commit_message == "$prefix"* ]]; then
valid_commit=1
break
fi
done
if [ $valid_commit -eq 1 ]; then
echo "Commit message includes a valid prefix. Build passed."
else
echo "Commit message does not include a valid prefix. Build failed."
exit 1
fi