ci: handle another PR failure case; more debug output

"Skip remaining CI steps" now also handles git log failure, continuing on instead of failing. Getting pretty gnarly.
This commit is contained in:
Simon Michael 2021-08-18 17:39:31 -10:00
parent 88b1d3f78b
commit 818e098b04
4 changed files with 18 additions and 11 deletions

View File

@ -87,11 +87,11 @@ jobs:
with:
fetch-depth: 0
# - name: Print debug output
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# run: |
# echo
- name: Print debug output
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo $GITHUB_CONTEXT
# echo "$GITHUB_SHA"
# echo "$GITHUB_REF"
@ -114,12 +114,14 @@ 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 commit range, checking last $NUM instead:"; bin/commitlint -$NUM )
- name: Skip remaining CI steps if latest commit message begins with ;
run: |
echo "git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog"
git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog
grep -qE '^ *;' $$.gitlog || echo "CONTINUE=true" >> $GITHUB_ENV
&& (grep -qE '^ *;' $$.gitlog || echo "CONTINUE=true" >> $GITHUB_ENV)
|| ( echo "could not identify commit range, continuing CI steps")
# things to be cached/restored:

View File

@ -75,8 +75,10 @@ jobs:
- name: Skip remaining CI steps if latest commit message begins with ;
run: |
echo "git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog"
git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog
grep -qE '^ *;' $$.gitlog || echo "CONTINUE=true" >> $GITHUB_ENV
&& (grep -qE '^ *;' $$.gitlog || echo "CONTINUE=true" >> $GITHUB_ENV)
|| ( echo "could not identify commit range, continuing CI steps")
# things to be cached/restored:

View File

@ -86,8 +86,10 @@ jobs:
- name: Skip remaining CI steps if latest commit message begins with ;
run: |
echo "git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog"
git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog
grep -qE '^ *;' $$.gitlog || echo "CONTINUE=true" >> $GITHUB_ENV
&& (grep -qE '^ *;' $$.gitlog || echo "CONTINUE=true" >> $GITHUB_ENV)
|| ( echo "could not identify commit range, continuing CI steps")
# things to be cached/restored:

View File

@ -68,10 +68,11 @@ jobs:
|| ( 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
run: |
echo "git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog"
git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog
grep -qE '^ *;' $$.gitlog || echo "CONTINUE=true" >> $GITHUB_ENV
&& (grep -qE '^ *;' $$.gitlog || echo "CONTINUE=true" >> $GITHUB_ENV)
|| ( echo "could not identify commit range, continuing CI steps")
# things to be cached/restored: