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: with:
fetch-depth: 0 fetch-depth: 0
# - name: Print debug output - name: Print debug output
# env: env:
# GITHUB_CONTEXT: ${{ toJson(github) }} GITHUB_CONTEXT: ${{ toJson(github) }}
# run: | run: |
# echo echo $GITHUB_CONTEXT
# echo "$GITHUB_SHA" # echo "$GITHUB_SHA"
# echo "$GITHUB_REF" # echo "$GITHUB_REF"
@ -114,12 +114,14 @@ jobs:
RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF}
git rev-list --quiet $RANGE \ git rev-list --quiet $RANGE \
&& bin/commitlint $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 ; - name: Skip remaining CI steps if latest commit message begins with ;
run: | 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 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: # things to be cached/restored:

View File

@ -75,8 +75,10 @@ jobs:
- name: Skip remaining CI steps if latest commit message begins with ; - name: Skip remaining CI steps if latest commit message begins with ;
run: | 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 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: # things to be cached/restored:

View File

@ -86,8 +86,10 @@ jobs:
- name: Skip remaining CI steps if latest commit message begins with ; - name: Skip remaining CI steps if latest commit message begins with ;
run: | 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 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: # things to be cached/restored:

View File

@ -68,10 +68,11 @@ jobs:
|| ( echo "could not identify commits, checking last $NUM instead:"; bin/commitlint -$NUM ) || ( echo "could not identify commits, checking last $NUM instead:"; bin/commitlint -$NUM )
- name: Skip remaining CI steps if latest commit message begins with ; - name: Skip remaining CI steps if latest commit message begins with ;
shell: bash
run: | 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 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: # things to be cached/restored: