diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 9b6342489..8aaab41f1 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -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" diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index fc136c8ff..25223fa95 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -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"