Skip to content

Commit 9cfc827

Browse files
authored
Merge pull request #89 from GitGuardian/agateau/fix-fixup-check
Fix fixup commit message checker failing on PR from forks
2 parents 2f2c455 + a7002c2 commit 9cfc827

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/test-lint.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ jobs:
5959
- name: Check commit messages
6060
if: github.event_name == 'pull_request'
6161
run: |
62-
if git log --format=%s "origin/$GITHUB_BASE_REF..origin/$GITHUB_HEAD_REF" | grep '^fixup!' ; then
62+
PR_REF="${GITHUB_REF%/merge}/head"
63+
git fetch origin "$PR_REF"
64+
if git log --format=%s "origin/$GITHUB_BASE_REF..FETCH_HEAD" | grep '^fixup!' ; then
6365
echo 'Error: this pull request contains fixup commits. Squash them.'
6466
exit 1
6567
fi

0 commit comments

Comments
 (0)