Skip to content

Commit

Permalink
Add check to prevent fixup commits from being merged
Browse files Browse the repository at this point in the history
  • Loading branch information
Josnoww committed Jun 18, 2024
1 parent 1bbff76 commit 0281732
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/check_fixup_commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Check Fixup Commits'
description: 'Checks for commits containing "Fixup!"'
inputs:
token:
description: 'GitHub Token'
required: true
runs:
using: 'composite'
steps:
- name: Set up Git
run: |
git fetch origin +refs/heads/*:refs/remotes/origin/*
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch --all
- name: Check for Fixup Commits in Pull Request
run: |
commits=$(git log origin/${{ github.event.pull_request.base.sha }}..origin/${{ github.event.pull_request.head.sha }} --oneline)
if echo "$commits" | grep -i "fixup!"; then
echo "::warning file=,line=,col=::There are commits containing 'Fixup!'"
exit 1
fi
shell: bash

0 comments on commit 0281732

Please sign in to comment.