From b8105c50ce71923139bf44c906a063e7632f172b Mon Sep 17 00:00:00 2001 From: Mitchell Williams Date: Thu, 28 May 2026 21:22:43 -0700 Subject: [PATCH] fix(ci): set +e before pr-file-overlap-check so warning doesn't hard-fail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #320 surfaced this: the workflow's run-block uses `bash -e` by default. The node script intentionally exits 2 when it detects critical-file overlap with another open PR (warn-only, per AGENTS.md § Bug class critical-file-parallel-pr-overlap). But `set -e` aborts the run block on the exit-2 immediately, so the trailing `EXIT_CODE=$?` + `exit 0` lines never run. Workflow reports failure even though the script's intent was to annotate the PR with a warning comment. Fix: prepend `set +e` at the top of the run block so exit-2 from the node call is captured into EXIT_CODE instead of aborting the script. The trailing `exit 0` then fires correctly, the github-script step still posts the warning comment when overlap is detected, and CI reports pass-with-warning instead of fail. Verification: - PR #320 (touches scripts/build-dashboard.mjs) + PR #319 (touches the same file) WILL produce an overlap warning under this fix — that's the intended behavior. The check will pass + post a warning comment. Surfaced via task-audit 2026-05-29 Theme-2 F104 ship. Bucket-A auto-merge per locked Q4 (workflows are NOT production-surface). Co-Authored-By: Claude Opus 4.7 --- .github/workflows/pr-file-overlap-check.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/pr-file-overlap-check.yml b/.github/workflows/pr-file-overlap-check.yml index 787a1304c..b709976e4 100644 --- a/.github/workflows/pr-file-overlap-check.yml +++ b/.github/workflows/pr-file-overlap-check.yml @@ -24,6 +24,13 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + # `bash -e` is the default for `run` blocks. Without `set +e` here, + # the node line aborts the whole script on the script's intentional + # exit-2 ("overlap detected, warn-only"), and the trailing + # `EXIT_CODE=$?` + `exit 0` never run. Workflow then reports + # failure even though the intent was a warning annotation. + # Surfaced via PR #320 2026-05-29. + set +e node scripts/check-pr-file-overlap.mjs ${{ github.event.pull_request.number }} > /tmp/overlap-report.txt 2>/tmp/overlap-stderr.txt EXIT_CODE=$? cat /tmp/overlap-stderr.txt >&2