Files
pandoc/.github/workflows/commit-validation.yml
dependabot[bot] 5d3b2916d6 Bump actions/checkout from 5 to 6 (#11302)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-24 10:48:37 +01:00

40 lines
1.1 KiB
YAML

name: commit-validation
on: [ push ]
permissions:
contents: read
jobs:
check-commit-msg-length:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check commit message length
id: check-commit-msg-length
uses: actions/github-script@v8
with:
result-encoding: json
script: |
var longlines = 0;
const commits = ${{ toJSON(github.event.commits) }};
for (const commit of commits) {
for (const line of commit.message.split('\n')) {
if (line.length > 78) {
longlines += 1;
console.log("Overlong line:\n" + line);
}
}
}
return longlines
- name: Get result
run: |
result=${{steps.check-commit-msg-length.outputs.result}}
if [[ $result -eq 0 ]]; then
echo "Ok"
exit 0
else
echo "Commit messages contain $result lines longer than 78 characters."
echo "See under 'Check commit message length' for a list of the lines."
exit 1
fi