diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e1ae7f3..e0b5d6e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,10 +21,10 @@ jobs: run: | echo "HEAD~1: $(git rev-parse HEAD~1)" echo "HEAD: $(git rev-parse HEAD)" - - name: Validate current commit (last commit) with commitlint + - name: Validate current and last commits if: github.event_name == 'push' - run: npx commitlint --from $(git rev-parse HEAD~1) --to $(git rev-parse HEAD) --verbose - - name: Validate PR commits with commitlint + run: npx commitlint --from $(git rev-parse --short HEAD^1) --to $(git rev-parse --short HEAD) --verbose + - name: Validate PR commits if: github.event_name == 'pull_request' run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose - run: yarn