fix: ci: when we can't figure out recent commits, don't check

This commit is contained in:
Simon Michael 2021-11-22 16:37:32 -10:00
parent e5678ce230
commit 5f55758ca4
4 changed files with 12 additions and 8 deletions

View File

@ -105,7 +105,7 @@ jobs:
# For a PR, the range will be: master..origin/$GITHUB_HEAD_REF
# For a push it will be: $BEFORE..
# For a force push, BEFORE is the previous HEAD, and on github (though not locally) this is an "invalid revision range".
# In this and any case where the range is invalid, we'll just check the last N commits.
# In this and any case where the range is invalid, we'll just skip the check, to avoid false positives
# related: https://stackoverflow.com/questions/64708371/how-to-run-github-workflow-on-every-commit-of-a-push
env:
BEFORE: ${{ github.event.before }}
@ -115,7 +115,8 @@ jobs:
RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF}
git rev-list --quiet $RANGE \
&& bin/commitlint $RANGE \
|| ( echo "could not identify commit range, checking last $NUM instead:"; bin/commitlint -$NUM )
|| ( echo "could not identify commits, not checking them" )
# || ( echo "could not identify commits, checking last $NUM instead:"; bin/commitlint -$NUM )
- name: Skip remaining CI steps if latest commit message begins with ;
shell: bash

View File

@ -62,7 +62,7 @@ jobs:
# For a PR, the range will be: master..origin/$GITHUB_HEAD_REF
# For a push it will be: $BEFORE..
# For a force push, BEFORE is the previous HEAD, and on github (though not locally) this is an "invalid revision range".
# In this and any case where the range is invalid, we'll just check the last N commits.
# In this and any case where the range is invalid, we'll just skip the check, to avoid false positives
# related: https://stackoverflow.com/questions/64708371/how-to-run-github-workflow-on-every-commit-of-a-push
env:
BEFORE: ${{ github.event.before }}
@ -72,7 +72,8 @@ jobs:
RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF}
git rev-list --quiet $RANGE \
&& bin/commitlint $RANGE \
|| ( echo "could not identify commits, checking last $NUM instead:"; bin/commitlint -$NUM )
|| ( echo "could not identify commits, not checking them" )
# || ( echo "could not identify commits, checking last $NUM instead:"; bin/commitlint -$NUM )
- name: Skip remaining CI steps if latest commit message begins with ;
shell: bash

View File

@ -73,7 +73,7 @@ jobs:
# For a PR, the range will be: master..origin/$GITHUB_HEAD_REF
# For a push it will be: $BEFORE..
# For a force push, BEFORE is the previous HEAD, and on github (though not locally) this is an "invalid revision range".
# In this and any case where the range is invalid, we'll just check the last N commits.
# In this and any case where the range is invalid, we'll just skip the check, to avoid false positives
# related: https://stackoverflow.com/questions/64708371/how-to-run-github-workflow-on-every-commit-of-a-push
env:
BEFORE: ${{ github.event.before }}
@ -83,7 +83,8 @@ jobs:
RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF}
git rev-list --quiet $RANGE \
&& bin/commitlint $RANGE \
|| ( echo "could not identify commits, checking last $NUM instead:"; bin/commitlint -$NUM )
|| ( echo "could not identify commits, not checking them" )
# || ( echo "could not identify commits, checking last $NUM instead:"; bin/commitlint -$NUM )
- name: Skip remaining CI steps if latest commit message begins with ;
shell: bash

View File

@ -55,7 +55,7 @@ jobs:
# For a PR, the range will be: master..origin/$GITHUB_HEAD_REF
# For a push it will be: $BEFORE..
# For a force push, BEFORE is the previous HEAD, and on github (though not locally) this is an "invalid revision range".
# In this and any case where the range is invalid, we'll just check the last N commits.
# In this and any case where the range is invalid, we'll just skip the check, to avoid false positives
# related: https://stackoverflow.com/questions/64708371/how-to-run-github-workflow-on-every-commit-of-a-push
env:
BEFORE: ${{ github.event.before }}
@ -65,7 +65,8 @@ jobs:
RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF}
git rev-list --quiet $RANGE \
&& bin/commitlint $RANGE \
|| ( echo "could not identify commits, checking last $NUM instead:"; bin/commitlint -$NUM )
|| ( echo "could not identify commits, not checking them" )
# || ( echo "could not identify commits, checking last $NUM instead:"; bin/commitlint -$NUM )
- name: Skip remaining CI steps if latest commit message begins with ;
shell: bash