Skip to content

fix(pr-pipeline): run the read runner's signed-commit check only when the lane can commit - #9268

Merged
kyle-sexton merged 1 commit into
mainfrom
fix/read-runner-signed-commit-gate
Oct 23, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
fix/read-runner-signed-commit-gate

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: fix-docs report failure on #9245, run 39874313435

Summary

In run 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

🤖 Generated with Claude Code

… the lane can commit

The report job's signed-commit step ran whenever can-commit was not 'false'.
When the run job gated no head SHA, can-commit is empty, so the step ran with
an empty since-sha, warned it could not verify, and then failed the job when
its label escalation was refused with a 403. A read activity cannot commit
(resolve-config sets can-commit from the contents grant), so gate the step on
can-commit == 'true' and a gated head SHA, and pin the gate in callers.test.mjs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T01:45:11.791041Z 27f10dd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 27f10dd954af50b6009178f512dd5bd4c16c860b: 0 finding(s), 0 as inline comments.

Security review: PR #9268 (head 27f10dd)

Result: no security findings. No inline comments were posted.

Scope: .github/workflows/pr-run-activity-read.yml (the if: of the signed step, line 2593) and .github/actions/resolve-config/callers.test.mjs (a new test for that condition). No plugin manifests changed, so there are no manifest <field> lines. The diff removes no standing instruction, so the instruction-surface lens had nothing to apply. I did not read the instruction exception register.

Analysis: the signed-commit check now requires can-commit == 'true' where it used to run on can-commit != 'false'. It also now requires a non-empty steps.head.outputs.sha.

  • When can-commit is empty, the check is now skipped. The report step still receives the empty can-commit (report-check-run.mjs L48-L55). It treats only the literal "false" as exempt from the signed-commit result. For an empty value it requires all_verified === "true", and a skipped check leaves that empty. The check run therefore reads as unverified (fail closed), not as a pass.
  • A read activity (can-commit == 'false') was already exempt, so that behaviour is unchanged.
  • The added steps.head.outputs.sha != '' condition only skips the check when no head SHA was selected. In that case since-sha would be empty, and no check run is posted on that path anyway.
  • The workflow header (L315-L326) already says nothing may trust this conclusion as merge evidence.

The test file is test-only and adds no attack surface.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 27f10dd954af50b6009178f512dd5bd4c16c860b: 0 finding(s), 0 as inline comments.

No findings. I reviewed the 2-file diff and found nothing to block.

What the PR does: The signed step in pr-run-activity-read.yml now runs only when needs.run.outputs.can-commit == 'true' and steps.head.outputs.sha != '' (plus the existing PR-number and not-forged conditions). A new test in callers.test.mjs covers the condition.

What I checked (read in the repo, not run):

  • can-commit comes from resolve-config.mjs:260, String(grant.contents !== "read"). It is "false" for the read effect and empty when config never resolved. The == 'true' gate therefore skips the step in both cases, which matches the PR's analysis.
  • The downstream consumer fails closed. report-check-run.mjs signedCommitsFrom treats any can-commit other than "false" as "the check should have run", and decide.mjs:129 then posts failure if all-verified is empty.
    • In the reported scenario (run gated no head, not-run-reason=not-assessed, run job skipped), decide returns neutral at the runResult === "skipped" && notRunReason branch before it reaches the signed-commit check. The check outcome should not change.
    • Where the step is now skipped for an empty can-commit, the lane posts a failing check ("could not be verified") rather than running the step. I judged that unreachable for a valid verdict, because an unresolved config reads invalid and fails earlier. It would be stricter than before, not looser.
  • The test's evaluate helper substitutes context names correctly for this expression. The cases cover can-commit true, false and empty, an empty head SHA, an empty PR number and a forged head. The PR says the test fails on the old != 'false' gate. I did not run the test suite.

Non-blocking note: The report-check-run input description for can-commit and the comment above signedCommitsFrom still say the signed-commit step runs unless can-commit is exactly false. The read workflow's step is now stricter than that. The behavior stays consistent because the consumer fails closed, so I left it unflagged.

Closing issue: None. The PR states "No related issue". Its description is data, and it contains no embedded instructions.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 79894c8 Oct 23, 2026
28 checks passed
@kyle-sexton
kyle-sexton deleted the fix/read-runner-signed-commit-gate branch October 23, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant