-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add conventional commit message check
- Loading branch information
1 parent
2546441
commit 046e2cf
Showing
4 changed files
with
29 additions
and
4 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Run Lua Language Server check | ||
name: Lua Language Server Check | ||
|
||
on: | ||
workflow_call: | ||
|
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Pull request check | ||
name: Pull Request Check | ||
|
||
on: | ||
pull_request: | ||
|
@@ -54,3 +54,28 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- name: Block Fixup Commit Merge | ||
uses: 13rac1/[email protected] | ||
|
||
conventional-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check Commit Messages | ||
run: | | ||
commits=$(git log --no-merges --pretty=format:"%s" HEAD~${{ github.event.pull_request.commits }}..HEAD) | ||
bad_commits=() | ||
for commit in "$commits"; do | ||
if ! echo $commit | grep -qE "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.+\))?: .+"; then | ||
bad_commits+=("$commit") | ||
fi | ||
done | ||
if [[ ${#bad_commits[@]} -ne 0 ]]; then | ||
echo "The following commits do not follow the Conventional Commit format:" | ||
for bad_commit in "${bad_commits[@]}"; do | ||
echo " - $bad_commit" | ||
done | ||
exit 1 | ||
fi |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Run tests | ||
name: Unit Tests | ||
|
||
on: | ||
workflow_call: | ||
|