mirror of
https://github.com/jgm/pandoc.git
synced 2026-07-10 19:37:12 +00:00
56df2f1c17
The PR event doesn't include the actual commits, just a count and a URL to fetch it. But we can checkout the entire git history, we don't have so many commits that we need to optimize this just yet. And then we might as well use `git` itself to walk the commit history. (Using the remote commits URL would be useful only if we'd want to do a shallow clone because we have too many commits) Signed-off-by: Edwin Török <edwin@etorok.net>
26 lines
667 B
YAML
26 lines
667 B
YAML
name: commit-validation-pr
|
|
on: [pull_request]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
check-commit-msg-length:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Check commit message length
|
|
run: |
|
|
git log ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | (
|
|
longlines=0
|
|
while IFS='' read -r line; do
|
|
if [ "${#line}" -gt 78 ]; then
|
|
echo "Overlong line: ${line}" >&2
|
|
longlines=$(( longlines + 1 ))
|
|
fi
|
|
done
|
|
[ "${longlines}" -eq 0 ]
|
|
)
|