nginx/.github/workflows/check-commit-message.yaml
Andrew Clayton 8f3465ac7f
Some checks are pending
buildbot / buildbot (push) Waiting to run
GH: explicitly set permissions in workflows
These will override the default repo/org GITHUB_TOKEN scope.
2026-06-30 19:36:43 +01:00

41 lines
1.1 KiB
YAML

name: Check Commit Message(s)
# Get the repository with all commits to ensure that we can
# analyze all of the commits contributed via the Pull Request.
on:
pull_request:
types: [ opened, synchronize ]
permissions:
contents: read
jobs:
check-commit-messages:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: check-commits.sh
run: |
echo "## Commit Message Linter Results" >${GITHUB_STEP_SUMMARY}
err=0
while read hash subj
do
echo "Checking: ${hash} (\"${subj}\")" | tee -a ${GITHUB_STEP_SUMMARY}
out=$(git show -s --format=%B ${hash} | .github/scripts/commit-msg-check.pl)
if test -n "${out}"
then
echo "${out}" | tee -a ${GITHUB_STEP_SUMMARY}
err=1
else
echo "✅ ok" | tee -a ${GITHUB_STEP_SUMMARY}
fi
done <<< $(git rev-list --oneline ${{github.event.pull_request.base.sha}}..${{github.event.pull_request.head.sha}})
if test ${err} -ne 0
then
exit 2
fi