diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3d3cbcc..64e7096 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,8 +25,8 @@ jobs: # check if commit exists first (e.g. it doesn't if it was force pushed) # or fall back to HEAD~1 run: | - git cat-file -t ${{ github.event.before }} > /dev/null - if [[ $? -eq "0" ]]; then + git cat-file -t ${{ github.event.before }} > /dev/null || COMMIT_NOT_FOUND=true + if [[ -z "$COMMIT_NOT_FOUND" ]]; then commitlint -V --from ${{ github.event.before }} else commitlint -V --from HEAD~1