From a7002c2931711800f0db209f568ad9cf7693a0d9 Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Thu, 11 Jan 2024 17:09:44 +0100 Subject: [PATCH] fix(ci): fixup commit message checker failing on PR from forks --- .github/workflows/test-lint.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-lint.yml b/.github/workflows/test-lint.yml index d480c22f..b5c8f4a1 100644 --- a/.github/workflows/test-lint.yml +++ b/.github/workflows/test-lint.yml @@ -59,7 +59,9 @@ jobs: - name: Check commit messages if: github.event_name == 'pull_request' run: | - if git log --format=%s "origin/$GITHUB_BASE_REF..origin/$GITHUB_HEAD_REF" | grep '^fixup!' ; then + PR_REF="${GITHUB_REF%/merge}/head" + git fetch origin "$PR_REF" + if git log --format=%s "origin/$GITHUB_BASE_REF..FETCH_HEAD" | grep '^fixup!' ; then echo 'Error: this pull request contains fixup commits. Squash them.' exit 1 fi