Skip to content

[#noissue] Cleanup #139

[#noissue] Cleanup

[#noissue] Cleanup #139

Workflow file for this run

name: Validate Commit Messages
on:
pull_request:
branches:
- '**'
jobs:
validate-commit-messages:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Validate commit messages
run: |
commit_msg=$(git show -s --format=%s)
commit_regex='^\[#(noissue|[0-9]+?)\].*'
error_msg="Commit message does not follow the Conventional Commits format:
[#issue-number] messge
Examples:
[#1001] Refactor servermap
[#noissue] Update README.md"
if ! echo "${commit_msg}" | grep -Eq "$commit_regex"; then
echo "$error_msg"
echo "Invalid commit message: \"${commit_msg}\""
exit 1
fi