Skip to content

Commit 57cb27a

Browse files
committed
fix: commitlint breaks on force-push due to job aborting prematurely
1 parent 7019b06 commit 57cb27a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ jobs:
2525
# check if commit exists first (e.g. it doesn't if it was force pushed)
2626
# or fall back to HEAD~1
2727
run: |
28-
git cat-file -t ${{ github.event.before }} > /dev/null
29-
if [[ $? -eq "0" ]]; then
28+
git cat-file -t ${{ github.event.before }} > /dev/null || COMMIT_NOT_FOUND=true
29+
if [[ -z "$COMMIT_NOT_FOUND" ]]; then
3030
commitlint -V --from ${{ github.event.before }}
3131
else
3232
commitlint -V --from HEAD~1

0 commit comments

Comments
 (0)