diff options
| author | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-03-05 12:14:59 -0500 |
|---|---|---|
| committer | nessita <124304+nessita@users.noreply.github.com> | 2026-03-06 17:55:01 -0300 |
| commit | c27d368b92f321e6f91704f554dccbc18df5b075 (patch) | |
| tree | b92d6e2623213917e668f1ed84076b2da0077ae4 /.github/workflows/check_commit_messages.yml | |
| parent | 9adc205b6d0269a81ce93a7e6d6b0f375f6bd526 (diff) | |
Extended checks and docs for proper commit message format and edition.
Thanks to Tim Schilling for the review.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Diffstat (limited to '.github/workflows/check_commit_messages.yml')
| -rw-r--r-- | .github/workflows/check_commit_messages.yml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/.github/workflows/check_commit_messages.yml b/.github/workflows/check_commit_messages.yml index 32f1558464..590cc58de3 100644 --- a/.github/workflows/check_commit_messages.yml +++ b/.github/workflows/check_commit_messages.yml @@ -68,3 +68,39 @@ jobs: fi echo "✅ All commits have the required prefix." + + check-commit-suffix: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + + - name: Fetch relevant branches + run: | + git fetch origin $BASE:base + git fetch origin pull/${{ github.event.pull_request.number }}/head:pr + + - name: Check commit messages suffix + run: | + COMMITS=$(git rev-list base..pr) + echo "Checking commit messages for trailing period" + FAIL=0 + for SHA in $COMMITS; do + MSG=$(git log -1 --pretty=%s $SHA) + echo "Checking commit $SHA: $MSG" + if [[ "${MSG: -1}" != "." ]]; then + echo "❌ Commit $SHA must end with a period." + echo "Refer to the guidelines linked in the PR checklist for commit message format." + echo "For how to rewrite commit messages, see https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/working-with-git/#editing-commit-messages" + FAIL=1 + fi + done + + if [[ $FAIL -eq 1 ]]; then + echo "One or more commit messages are missing a trailing period." + exit 1 + fi + + echo "✅ All commits have the required trailing period." |
