Skip to content

Migrate pr-review.yml caller to secrets: inherit (last by-name pr-review caller) #385

Closed

Description

@don-petry

Goal

Migrate .github/workflows/pr-review.yml from by-name secret passing to secrets: inherit, matching every other pr-review caller in the org.

Why

TalkTerm is the last pr-review caller that passes secrets by name:

    secrets:
      CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
      GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
      COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
      DON_PETRY_BOT_GH_PAT: ${{ secrets.DON_PETRY_BOT_GH_PAT }}
      DON_PETRY_BOT_GH_PAT_CLASSIC: ${{ secrets.DON_PETRY_BOT_GH_PAT_CLASSIC }}
      GH_PAT: ${{ secrets.GH_PAT }}

This forces the shared reusable pr-review.yml to keep COPILOT_GITHUB_TOKEN/GH_PAT workflow_call.secrets declarations and a by-name fallback purely for this one caller (combsmith/.github-private#1327). The other 6 pr-review callers (ContentTwin, markets, bmad-bgreat-suite, google-app-scripts, broodly, .github-private) already use secrets: inherit, and TalkTerm's own dev-lead.yml already does too.

Migrating unblocks the final Copilot-token cleanup: dropping the reusable's by-name fallback + declarations and deleting the retired GH_PAT secret.

Change

Replace the explicit secrets: block in the review job of .github/workflows/pr-review.yml with:

    secrets: inherit  # NOSONAR(githubactions:S7635) first-party trusted reusable

(Match the canonical caller-stub form used by the other pr-review consumers and by TalkTerm's dev-lead.yml.)

Acceptance

Activity

  1. don-petry commented on Jul 20, 2026

    @don-petry
    ContributorAuthor

    Dev-Lead Implementation Plan

    Issue: #385 — Migrate pr-review.yml caller to secrets: inherit (last by-name pr-review caller)

    Scope

    Replace the explicit by-name secrets: mapping in the review job of .github/workflows/pr-review.yml with the canonical secrets: inherit caller-stub form used by every other pr-review consumer and by TalkTerm's own dev-lead.yml.

    Implementation Checklist

    • .github/workflows/pr-review.yml — replace the six-line by-name secrets: block (lines 85–91) with secrets: inherit # NOSONAR(githubactions:S7635) first-party trusted reusable
    • Update the stale header comment (line 22) that says "Secrets are passed explicitly to the reusable workflow" to reflect secrets: inherit, preserving the classic-PAT note about DON_PETRY_BOT_GH_PAT_CLASSIC

    Tests to Write

    • None. This is a pure CI configuration change with no application-code behavior. Per the Phase 2 TDD exception (config-only, no observable code behavior change), no unit/integration tests apply. Validation is via YAML lint + workflow syntax and the CI green requirement in Acceptance.

    Test Command

    npm test (unaffected by this change; run for regression) + bash .dev-lead/scripts/dev-lead-lint.sh

  2. don-petry commented on Jul 20, 2026

    @don-petry
    ContributorAuthor

    Dev-Lead: Implementation Complete

    Plan Execution

    Acceptance Check

    Test Results

    No application test suite exists in this repo yet (no package.json/source — only planning artifacts + CI scaffolding). Per the Phase 2 TDD exception this is a config-only change with no observable code behavior. Validation run:

    $ python3 -c "import yaml; yaml.safe_load(open('.github/workflows/pr-review.yml'))"  ->  YAML OK
    $ bash .dev-lead/scripts/dev-lead-lint.sh
      [lint] shellcheck on 5 file(s)...
      [lint] validating CODEOWNERS...
    OK: CODEOWNERS
      [lint] all checks passed
    

    Files Changed

    • .github/workflows/pr-review.yml: swapped by-name secret passing for secrets: inherit (canonical caller-stub form) and refreshed the corresponding header comment.
    diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml
    index 769f771..0e971f8 100644
    --- a/.github/workflows/pr-review.yml
    +++ b/.github/workflows/pr-review.yml
    @@ -19,7 +19,10 @@ name: PR Review Agent
     #   `sonar-project.properties` exemption, which only quieted the gate).
     # - `agent_ref: pr-review/stable` pins the agent's own scripts to the same
     #   channel (#506), so the review logic AND scripts run the known-good version.
    -# - Secrets are passed explicitly to the reusable workflow.
    +# - Secrets are forwarded via `secrets: inherit` — the canonical caller-stub form
    +#   shared by every other pr-review consumer and by TalkTerm's own dev-lead.yml.
    +#   This lets the reusable drop its by-name `workflow_call.secrets` fallback
    +#   (petry-projects/.github-private#1327). Among the inherited secrets,
     #   `DON_PETRY_BOT_GH_PAT_CLASSIC` is a classic PAT — required for approvals since
     #   fine-grained PATs cannot `addPullRequestReview`.
     
    @@ -82,10 +85,4 @@ jobs:
           pr_url: ${{ inputs.pr_url || '' }}
           dry_run: ${{ inputs.dry_run || '' }}
           force_review: ${{ inputs.force_review || '' }}
    -    secrets:
    -      CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
    -      GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
    -      COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
    -      DON_PETRY_BOT_GH_PAT: ${{ secrets.DON_PETRY_BOT_GH_PAT }}
    -      DON_PETRY_BOT_GH_PAT_CLASSIC: ${{ secrets.DON_PETRY_BOT_GH_PAT_CLASSIC }}
    -      GH_PAT: ${{ secrets.GH_PAT }}
    +    secrets: inherit  # NOSONAR(githubactions:S7635) first-party trusted reusable

    Notes

    Change is confined to the target workflow file — no unrelated files touched. The inherited-secrets set now covers the Copilot engine's GH_PAT_DON_PETRY centrally (no per-caller mapping needed). yamllint flags default 80-char line-length on several lines, but these pre-exist (e.g. the 145-char uses: line) and are not repo-enforced (no .yamllint config), so they are left as-is.

  3. added
    dev-leadFor dev-lead agent pickup
    and removed
    dev-leadFor dev-lead agent pickup
    on Jul 21, 2026
  4. don-petry commented on Jul 21, 2026

    @don-petry
    ContributorAuthor

    Dev-Lead Implementation Plan

    Issue: #385 — Migrate pr-review.yml caller to secrets: inherit (last by-name pr-review caller)

    Scope

    Replace the explicit by-name secrets: mapping in the review job of .github/workflows/pr-review.yml with the canonical secrets: inherit caller-stub form, matching every other pr-review consumer and TalkTerm's own dev-lead.yml.

    Implementation Checklist

    • Replace the 6-line secrets: block (lines 85–91) with secrets: inherit # NOSONAR(githubactions:S7635) first-party trusted reusable
    • Update the stale header comment (line 22, "Secrets are passed explicitly to the reusable workflow.") to reflect secrets: inherit

    Tests to Write

    • None. This is a behavior-preserving workflow-configuration change with no observable code behavior; no test infrastructure exists for CI workflow YAML. Per the Phase 2 documented exception, TDD is skipped. Verification is via CI (the pr-review workflow still runs and the Copilot engine authenticates via the inherited GH_PAT_DON_PETRY).

    Test Command

    npm test (unaffected — no source code changes)

  5. don-petry commented on Jul 21, 2026

    @don-petry
    ContributorAuthor

    Dev-Lead: Implementation Complete

    Plan Execution

    • Replaced the 6-line by-name secrets: block in the review job with secrets: inherit # NOSONAR(githubactions:S7635) first-party trusted reusable (canonical caller-stub form, matches dev-lead.yml)
    • Updated the stale header comment ("Secrets are passed explicitly…") to describe secrets: inherit, preserving the DON_PETRY_BOT_GH_PAT_CLASSIC classic-PAT rationale
    • Verified YAML validity and passed the required dev-lead-lint.sh

    Test Results

    No unit tests apply — this is a behavior-preserving GitHub Actions workflow-config change with no source code impact (Phase 2 TDD exception). Verification performed:

      [lint] shellcheck on 5 file(s)...
      [lint] validating CODEOWNERS...
    OK: CODEOWNERS
      [lint] all checks passed
    
    YAML valid
    

    Functional verification happens in CI: the pr-review workflow still runs and the Copilot engine authenticates via the inherited GH_PAT_DON_PETRY.

    Files Changed

    • .github/workflows/pr-review.yml: replaced explicit by-name secrets: mapping (CLAUDE_CODE_OAUTH_TOKEN, GOOGLE_API_KEY, COPILOT_GITHUB_TOKEN, DON_PETRY_BOT_GH_PAT, DON_PETRY_BOT_GH_PAT_CLASSIC, GH_PAT) with secrets: inherit; refreshed the corresponding header comment.

    Notes

  6. added a commit that references this issue on Aug 2, 2026
  7. added 3 commits that reference this issue on Aug 31, 2026
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

    dev-leadFor dev-lead agent pickup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions