Add git minimum length body count validator #6
Workflow file for this run
This file contains hidden or 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
| name: Check if commit message body is not too short | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, edited, reopened] | |
| jobs: | |
| verify-body-length: | |
| runs-on: ubuntu-latest | |
| # set as non-voting for now. | |
| continue-on-error: true | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| repository-projects: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Run commit message check | |
| id: bodylength | |
| run: | | |
| git log | |
| git branch | |
| ./scripts/git-check-commit-body-length.sh || true | |
| set +e | |
| ./scripts/git-check-commit-body-length.sh > result.log 2>&1 | |
| EXIT_CODE=$? | |
| echo "exit_code=$EXIT_CODE" >> $GITHUB_OUTPUT | |
| cat result.log | |
| - name: Comment on PR if body length check failed | |
| if: steps.bodylength.outputs.exit_code != '0' | |
| uses: peter-evans/create-or-update-comment@v5 | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body-path: ./result.log | |
| reactions: confused |