mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-25 17:56:32 +00:00
Actions: Remove commit-validation.yml workflow.
This is useless because it runs after the push; we need this check for pull requests but not for core committers. (They should use a pre-commit hook.)
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
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
|
||||
Reference in New Issue
Block a user