ci: lint pull request

This commit is contained in:
Ben Grande 2024-01-28 23:13:24 +01:00
parent 03cb70c2c2
commit 77d82811ad
2 changed files with 12 additions and 4 deletions

View File

@ -46,9 +46,17 @@ jobs:
- name: Lint commits
# yamllint disable-line rule:line-length
run: |
if test "${{ github.event.before }}" = "${{ github.event.after }}" || test -z "${{ github.event.before }}"
if test "${{ github.event_name}}" = "pull_request"
then
gitlint --debug --commit "${{ github.event.after }}"
base="${{ github.event.pull_request.base.sha }}"
head="${{ github.event.pull_request.head.sha }}"
else
gitlint --debug --commits "${{ github.event.before }}..${{ github.event.after }}"
base="${{ github.event.before }}"
head="${{ github.event.after }}"
fi
if test "${base}" = "${head}" || test -z "${base}"
then
gitlint --debug --commit "${head}"
else
gitlint --debug --commits "${base}..${head}"
fi

View File

@ -32,7 +32,7 @@ line-length=72
min-length=20
[body-is-missing]
ignore-merge-commits=false
ignore-merge-commits=true
[ignore-body-lines]
regex=(^Co-Authored-By)|(^Reported-by)|(^Signed-off-by)