From 330df058916d041814515d53e221c6fe0d9fe95e Mon Sep 17 00:00:00 2001 From: Taimoor Zaeem Date: Wed, 18 Jun 2025 21:17:01 +0500 Subject: [PATCH] ci: only run commitlint on github PRs The `commitlint` script disrupts our release workflow if failed on push event. We also don't need it on push because once pushed, git commit history can't be amended. --- .github/workflows/check.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 64068dea9..49601b368 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -32,6 +32,7 @@ jobs: run: postgrest-style-check commit: + if: github.event_name != 'push' # we don't run this on a push, a failure on push disrupts the release workflow name: Commit runs-on: ubuntu-24.04 steps: @@ -46,9 +47,7 @@ jobs: - name: Run commitlint (check locally with `nix-shell --run postgrest-commitlint`) run: | # Fetch target branch explicitly - # For PRs event -> github.base_ref - # For push event -> github.ref_name - git fetch origin ${{ github.base_ref || github.ref_name }} + git fetch origin ${{ github.base_ref }} # Run commitlint - postgrest-commitlint --from origin/${{ github.base_ref || github.ref_name }} --to HEAD + postgrest-commitlint --from origin/${{ github.base_ref }} --to HEAD