Skip to content

Add check to prevent fixup commits from being merged #1

Add check to prevent fixup commits from being merged

Add check to prevent fixup commits from being merged #1

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