From 7f8e58fa9b87e5914ae416b2e938ad194f01a244 Mon Sep 17 00:00:00 2001 From: Alex Archambault Date: Fri, 18 Sep 2026 15:47:48 +0200 Subject: [PATCH] Reject mixed dist and source changes Prevent pull requests from combining changes under dist/ with changes elsewhere. Co-authored-by: Claude Opus 5 --- .github/workflows/no-dist-changes.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/no-dist-changes.yml b/.github/workflows/no-dist-changes.yml index 83f2528..dc735f8 100644 --- a/.github/workflows/no-dist-changes.yml +++ b/.github/workflows/no-dist-changes.yml @@ -1,6 +1,6 @@ # >>> SLOP <<< # Generated by OpenAI GPT-5.2 Codex -name: Block dist changes +name: Block mixed dist changes on: pull_request: @@ -11,12 +11,17 @@ jobs: - uses: actions/checkout@v7 with: fetch-depth: 0 - - name: Fail on dist changes + - name: Fail on mixed dist changes shell: bash run: | - changed=$(git diff --name-only "origin/${{ github.base_ref }}...HEAD" -- dist/) - if [ -n "$changed" ]; then - echo "::error::Changes under dist/ are not allowed in PRs. Files under dist/ are updated by CI and don't need to be committed." - echo "$changed" + base="origin/${{ github.base_ref }}...HEAD" + dist_changed=$(git diff --name-only "$base" -- dist/) + other_changed=$(git diff --name-only "$base" -- . ':(exclude)dist/') + if [ -n "$dist_changed" ] && [ -n "$other_changed" ]; then + echo "::error::A PR must not mix changes under dist/ with changes elsewhere. Files under dist/ are updated by CI and don't need to be committed." + echo "Changes under dist/:" + echo "$dist_changed" + echo "Changes elsewhere:" + echo "$other_changed" exit 1 fi