diff --git a/.github/workflows/check_fixup_commits.yml b/.github/workflows/check_fixup_commits.yml new file mode 100644 index 0000000..da7764b --- /dev/null +++ b/.github/workflows/check_fixup_commits.yml @@ -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 +