Skip to content

Commit

Permalink
Merge pull request #89 from GitGuardian/agateau/fix-fixup-check
Browse files Browse the repository at this point in the history
Fix fixup commit message checker failing on PR from forks
  • Loading branch information
agateau-gg authored Jan 12, 2024
2 parents 2f2c455 + a7002c2 commit 9cfc827
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9cfc827

Please sign in to comment.