From 31e82efb43d130303038e202b43678050c6f763b Mon Sep 17 00:00:00 2001 From: Josnoww Date: Tue, 26 Aug 2025 15:21:52 +0200 Subject: [PATCH] boyscout: Add workflow to check for fixup commits before merging --- .github/workflows/do_not_merge_fixups.yaml | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/do_not_merge_fixups.yaml diff --git a/.github/workflows/do_not_merge_fixups.yaml b/.github/workflows/do_not_merge_fixups.yaml new file mode 100644 index 0000000..e7e212a --- /dev/null +++ b/.github/workflows/do_not_merge_fixups.yaml @@ -0,0 +1,27 @@ +name: Check commits + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + check-for-fixup-commits: + name: 'Check !fixup commits' + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # fetch all commits + + - name: Check commit messages + run: | + echo "Target branch: ${{ github.base_ref }}" + forbidden=$(git log origin/${{ github.base_ref }}..HEAD --pretty=format:%s | grep -i '!fixup' || true) + if [ -n "$forbidden" ]; then + echo "❌ Found commit(s) with '!fixup' in the title:" + echo "$forbidden" + exit 1 + fi