Skip to content

Move the hosted review lanes to workflow_run so no Claude secret is read on a PR-branch copy #17537

Closed as not planned

Description

@kyle-sexton

Problem

pr-review-hosted.yml and pr-review-security-hosted.yml still start on pull_request, so the head's copy of each caller decides what receives REVIEWS_CLAUDE_API_KEY, REVIEWS_CLAUDE_CODE_OAUTH_TOKEN and FALLBACK_CLAUDE_CODE_OAUTH_TOKEN. Once ci-workflows#1154 merges they can pass environment: claude-lanes, but the environment refuses a pull_request run, which GitHub checks against refs/pull/<n>/merge (changelog). The lanes have to move to a main-copy trigger before this repository's access to the organization copies can be removed.

What is already there

pr-review-cli.yml already supports a workflow_run caller through pr-number and head-sha: its resolve-pull-request job re-reads the pull request (header, "A workflow_run caller").

What has to change here

  • Each job's check runs attach to the run's SHA, which is main's for workflow_run. So pr-review / claude-review-status would leave the PR head, and ci-status, the merge gate (babysit_review_evidence) and wait-refine.mjs read only pull_request runs on the head (pr-review-hosted.yml, the wait-for-refine comment). pr-review-main.yml already posts its verdict counts as a head check run and binds verdicts from a workflow_run run, so it is the in-repo precedent.
  • Map every reader of the hosted review check and runs before moving the callers.

Done when

  • Both hosted review callers start on workflow_run, pass environment: claude-lanes, and no job reads a Claude secret on a PR-branch copy.
  • PENDING_REMOTE in scripts/check-claude-secrets-environment.mjs is empty, and ci-status and the merge gate bind the moved lanes' verdicts on the head.

Refs: #17516

Activity

  1. github-actions commented on Nov 20, 2026

    @github-actions
    Contributor

    The triage sweep dispatched intake triage for this issue (dispatch 1; 2 runs that reach intake, or 6 dispatches, hand it to a maintainer).

  2. github-actions commented on Nov 20, 2026

    @github-actions
    Contributor

    Size: Large
    Complexity: High
    Uncertainty: Knowable
    Flags: none
    Blocked by: none
    Blast radius: the two hosted PR-review caller workflows, ci-status, the merge gate (babysit_review_evidence), wait-refine.mjs and scripts/check-claude-secrets-environment.mjs; every PR's review checks and the maintainers and lanes that read them.
    Reversible: yes; revert the workflow and script changes, though the org-secret removal it enables is a separate step.
    Open questions: none
    Understood: move pr-review-hosted.yml and pr-review-security-hosted.yml to a workflow_run trigger from main with environment claude-lanes, so no Claude secret is read on a PR-branch copy. Verdict check runs must also be posted on the PR head, as pr-review-main.yml already does, and every reader of the hosted review check must be mapped first. The change is split across several workflows, scripts and the merge gate, so it likely needs splitting into steps. It depends on ci-workflows#1154 merging. Related: #17516 and the open issue on verifying the claude-lanes lanes (see the open-issues list). No duplicate or merged fix found.

    Automated triage. A maintainer reviews it.

  3. melodic-automation-lanes commented on Nov 20, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane: no trusted-human acceptance criteria: a listed human must put the confirmed - [ ] criteria in the body or post them as their own comment, or, on an issue a listed human filed, intake's newest refinement comment must hold them unedited. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).

  4. melodic-automation-lanes commented on Nov 20, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: Both hosted review callers start from main on workflow_run with environment claude-lanes, post their review-status verdicts as check runs on the PR head, and every reader of those checks binds them there, once ci-workflows#​1154 merges.

    Related work

    Open questions

    1. Which upstream workflow does the hosted callers' workflow_run trigger on, and which runs start a review?
      RECOMMENDED: Follow pr-review-main.yml: trigger on the same upstream pull_request workflow, only on success and a same-repository head, and pass pr-number and head-sha to pr-review-cli.yml. Basis: .base/.github/workflows/pr-review-main.yml:73
    2. How does the wait for the head's Refine work once the review runs outside the head's pull_request run? Its header says it waits there because Refine started with GITHUB_TOKEN fires no workflow_run event.
      RECOMMENDED: Keep a wait-for-refine job in the workflow_run run, reading the head sha from the resolved pull request, and update wait-refine.mjs to take it from there. Basis: .base/.github/workflows/pr-review-hosted.yml:160
    3. Where is the review-status verdict posted, and which readers change: ci-status, babysit_review_evidence, wait-refine.mjs, the lost-run reconciler?
      RECOMMENDED: Post a head-SHA check run named as today (pr-review / claude-review-status), as pr-review-main.yml does, and make every reader bind that check instead of pull_request runs. Map the readers in a first step. Basis: .base/.github/workflows/pr-review-hosted.yml:240
    4. Is the work delivered as one change or in steps, given that ci-workflows#​1154 must merge first?
      RECOMMENDED: Split into steps: map the readers, move the callers and check posting, then clear PENDING_REMOTE for both callers. Start only after ci-workflows#​1154 merges. Basis: .base/scripts/check-claude-secrets-environment.mjs:24

    Sources read

    • .base/scripts/check-claude-secrets-environment.mjs:24: PENDING_REMOTE still lists pr-review-hosted.yml#pr-review and pr-review-security-hosted.yml#pr-review-security, pending #​17537.
    • .base/.github/workflows/pr-review-hosted.yml:38: starts on pull_request with opened, synchronize, ready_for_review and reopened.
    • .base/.github/workflows/pr-review-hosted.yml:160: wait-for-refine waits inside the pull_request run because the readers find only pull_request runs on the head.
    • .base/.github/workflows/pr-review-hosted.yml:459: the secrets are passed from REVIEWS_CLAUDE_API_KEY and the two OAuth tokens, with no environment input yet.
    • .base/.github/workflows/pr-review-main.yml:73: precedent workflow_run trigger from main with a success and same-repository head filter.

    To answer, post a comment that starts with this line:

    **Decision recorded.** <answer>
    

    Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.

  5. kyle-sexton commented on Nov 20, 2026

    @kyle-sexton
    MemberAuthor

    Superseded: the owner backed out the claude-lanes environment move (hub Q242, 2026-11-20, owner: "Yeah, go with recommendations."). This issue existed only so the hosted review lanes could reach secrets kept in claude-lanes; with the org secrets kept as the single source, it has no remaining purpose. Phase A PR #17584 is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Work status

    needs-owner-decision

    Priority

    medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions