Skip to content

Commit

Permalink
fix: commitlint breaks on force-push due to job aborting prematurely
Browse files Browse the repository at this point in the history
  • Loading branch information
krsche committed May 19, 2023
1 parent 7019b06 commit 57cb27a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 57cb27a

Please sign in to comment.