ci: push, pull: clarify, robustify? commitlint step

This commit is contained in:
Simon Michael 2022-01-06 06:31:53 -10:00
parent 0a8835ada2
commit 56e015c409
2 changed files with 14 additions and 12 deletions

View File

@ -79,16 +79,18 @@ jobs:
# related: https://stackoverflow.com/questions/64708371/how-to-run-github-workflow-on-every-commit-of-a-push
env:
BEFORE: ${{ github.event.before }}
NUM: 5
# NUM: 5
shell: bash
run: |
RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF}
git rev-list --quiet $RANGE \
&& tools/commitlint $RANGE \
|| ( echo "could not identify commits, not checking them" )
# || ( echo "could not identify commits, checking last $NUM instead:"; tools/commitlint -$NUM )
if git rev-list --quiet $RANGE
then tools/commitlint $RANGE
else echo "could not identify commits, not checking them"
# echo "could not identify commits, checking last $NUM instead:"
# tools/commitlint -$NUM
fi
- name: Skip remaining CI steps if latest commit message begins with ;
- name: Skip remaining steps if last commit message begins with ;
shell: bash
run: |
echo "git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog"

View File

@ -76,16 +76,16 @@ jobs:
# related: https://stackoverflow.com/questions/64708371/how-to-run-github-workflow-on-every-commit-of-a-push
env:
BEFORE: ${{ github.event.before }}
NUM: 5
# NUM: 5
shell: bash
run: |
RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF}
git rev-list --quiet $RANGE \
&& tools/commitlint $RANGE \
|| ( echo "could not identify commits, not checking them" )
# || ( echo "could not identify commits, checking last $NUM instead:"; tools/commitlint -$NUM )
if git rev-list --quiet $RANGE
then tools/commitlint $RANGE
else echo "could not identify commits, not checking them"
fi
- name: Skip remaining CI steps if latest commit message begins with ;
- name: Skip remaining steps if last commit message begins with ;
shell: bash
run: |
echo "git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog"