Add check to prevent fixup commits from being merged #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |