There was an error while loading. Please reload this page.
1 parent adeace4 commit c839299Copy full SHA for c839299
1 file changed
.github/workflows/prek-check.yml
@@ -49,4 +49,16 @@ jobs:
49
50
- name: Run prek checks (push)
51
if: github.event_name == 'push'
52
- run: prek run --from-ref ${{ github.event.before }} --to-ref ${{ github.event.after }} --show-diff-on-failure
+ env:
53
+ BEFORE: ${{ github.event.before }}
54
+ AFTER: ${{ github.event.after }}
55
+ run: |
56
+ # A push that creates a branch reports an all-zero "before", and a
57
+ # force-push can name one this clone no longer has. Neither is a commit,
58
+ # so the range would be invalid; check every file instead.
59
+ if git rev-parse --verify --quiet "$BEFORE^{commit}" >/dev/null; then
60
+ prek run --from-ref "$BEFORE" --to-ref "$AFTER" --show-diff-on-failure
61
+ else
62
+ echo "no usable base commit ($BEFORE); checking all files"
63
+ prek run --all-files --show-diff-on-failure
64
+ fi
0 commit comments