-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zess: add commit message check workflow
- Loading branch information
1 parent
0000001
commit 7b3f07d
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: commit message check | ||
run-name: commit message check | ||
on: [push] | ||
|
||
jobs: | ||
check_commit_messages: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: get main | ||
run: git fetch origin main | ||
|
||
- name: list branches | ||
run: git branch -v | ||
|
||
- name: check commit messages | ||
run: | | ||
git log --format="%s" origin/main..HEAD | while IFS= read -r message; do | ||
if ! [[ $commit_message =~ ^(vingo:|vinscant:|vinvoor:|zess:) ]]; then | ||
echo $commit_message | ||
echo "Error: commit message should start with vingo:|vinscant:|vinvoor:|zess: depending on which subproject you are working on." | ||
exit 1 | ||
fi | ||
if ! [[ $commit_message =~ ^.*:\ [a-z].* ]]; then | ||
echo $commit_message | ||
echo "Error: first letter after project specifier should be lower case" | ||
exit 1 | ||
fi | ||
done |