feat: Create asdf.txt #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |