Skip to content

Commit 79894c8

Browse files
kyle-sextonclaude
andauthored
fix(pr-pipeline): run the read runner's signed-commit check only when the lane can commit (#9268)
No related issue: fix-docs report failure on #9245, run 39874313435 ## Summary In [run 39874313435](https://github.com/melodic-software/claude-code-plugins/actions/runs/39874313435), job "fix-docs / report" on PR #9245 failed. The run job gated no head SHA, so its `can-commit` output was empty. The report job's `signed` step gated on `can-commit != 'false'`, which an empty value passes. It ran `check-signed-commits` with an empty `since-sha`, warned "could not verify the lane's commits (the PR's head never matched its branch)", then failed the job when the label escalation got a 403 on `POST .../issues/9245/labels`. ## Fix In `.github/workflows/pr-run-activity-read.yml`, the `signed` step now runs only when `needs.run.outputs.can-commit == 'true'` and `steps.head.outputs.sha != ''`; the PR number and not-forged conditions are kept. No read-runner caller has `can-commit` true. The read workflow fails red on any effect but `read` (`effect-not-read`), the read effect grants `contents: read`, and `resolve-config.mjs:260` sets `can-commit` to `String(grant.contents !== "read")`, so it is `false` whenever config resolves and empty otherwise. The `fix-ci`, `fix-docs` and `resolve-issue` activities all forbid `mutate-branch`. The step is kept, not deleted, so a future read-runner activity with a write grant stays covered. `pr-run-activity-write.yml` has the same `!= 'false'` shape but gates on `pr-number != ''`, and its activities can commit, so it is a different context and is unchanged. ## Verification - New test in `.github/actions/resolve-config/callers.test.mjs` evaluates the step's `if` for `can-commit` `true`, `false` and empty, an empty head SHA, an empty PR number and a forged head. It fails on the old gate (`can-commit ''`) and passes on the new one. - `callers.test.mjs`: 102 pass. `check-signed-commits` tests: 33 pass. `actionlint` on the workflow: clean. - `scripts/check-affected.sh --tests`: 9 passed, 5 skipped (no markdown, shell, plugin, Python or skill changes). - No changelog fragment: no plugin or convention file changed. ## Related - Failing run: https://github.com/melodic-software/claude-code-plugins/actions/runs/39874313435 - PR #9245 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent bc30613 commit 79894c8

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

‎.github/actions/resolve-config/callers.test.mjs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2778,6 +2778,18 @@ test("report job: a run head equal to a PR head that moved mid-run, never gated,
27782778
assert.equal(signed.with["since-sha"], "${{ steps.head.outputs.sha }}");
27792779
});
27802780

2781+
test("report job: the signed-commit check runs only when the lane can commit and a head SHA was gated", () => {
2782+
const signed = reportSteps().find((s) => s.id === "signed");
2783+
const ctx = { "needs.run.outputs.can-commit": "true", "steps.pr-head.outputs.number": "7", "steps.head.outputs.sha": TRUSTED, "steps.head.outputs.forged": "false" };
2784+
const runs = (over) => Boolean(evaluate(signed.if.replaceAll("always()", "true"), { ...ctx, ...over }));
2785+
assert.equal(runs({}), true);
2786+
// A read activity cannot commit, and a run that gated no head leaves can-commit empty.
2787+
for (const canCommit of ["false", ""]) assert.equal(runs({ "needs.run.outputs.can-commit": canCommit }), false, `can-commit '${canCommit}'`);
2788+
assert.equal(runs({ "steps.head.outputs.sha": "" }), false);
2789+
assert.equal(runs({ "steps.pr-head.outputs.number": "" }), false);
2790+
assert.equal(runs({ "steps.head.outputs.forged": "true" }), false);
2791+
});
2792+
27812793
test("report job: an empty run head after the kill switch or a broker refusal posts nothing, so the owner's switch is never a merge blocker", (t) => {
27822794
const steps = reportSteps();
27832795
// The broker-check job's allow alone, which already holds its kill switch

‎.github/workflows/pr-run-activity-read.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2742,8 +2742,9 @@ jobs:
27422742
id: signed
27432743
if: >-
27442744
always()
2745-
&& needs.run.outputs.can-commit != 'false'
2745+
&& needs.run.outputs.can-commit == 'true'
27462746
&& steps.pr-head.outputs.number != ''
2747+
&& steps.head.outputs.sha != ''
27472748
&& steps.head.outputs.forged == 'false'
27482749
uses: ./.base/.github/actions/check-signed-commits # zizmor: ignore[self-repository]
27492750
with:

0 commit comments

Comments
 (0)