Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 31 additions & 36 deletions .github/workflows/pr-review-hosted.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,35 @@
name: PR Review Hosted

# SYNC-MANAGED FILE: DO NOT EDIT IN THE CONSUMING REPOSITORY.
# SYNC-MANAGED FILE — DO NOT EDIT IN THE CONSUMING REPOSITORY.
# Source of truth: melodic-software/standards,
# components/claude-lanes-hosted/claude-review.yml (the
# `claude-review-hosted-caller` component in distribution/sync-manifest.yml).
# Downstream edits are overwritten by the next sync PR; change the component
# upstream, or move the component to `locally-owned` in the manifest to
# customize.
#
# Thin caller for the org's reusable code-review lane. The reusable workflow
# owns the action pin, model, and the secret-handling model; per its header,
# this caller owns the triggers, concurrency, and the GITHUB_TOKEN permission
# grant (a called workflow can only downgrade the caller's grant, never
# elevate it).
# Thin caller for the org's pr-review-cli reusable, lane `code`. The reusable
# workflow owns the launcher, the credential order (the reviews role's API key,
# then its subscription token after a handoff, then the central fallback
# subscription), and the secret-handling model; per its header, this caller
# owns the triggers, concurrency, and the GITHUB_TOKEN permission grant (a
# called workflow can only downgrade the caller's grant, never elevate it).
#
# The reusable skips fork PRs (they receive no secrets and a read-only token)
# and every `[bot]` actor whose sender id is not in `allowed-bot-sender-ids`
# (below), so neither is reviewed by design. On a public repository that means
# the lane reviews only pull requests from branches of this repository: fork
# and Dependabot pull requests get no secrets.
# The reusable skips fork PRs (they receive no secrets and a read-only token),
# Dependabot, and every `[bot]` actor whose sender id is not in
# `allowed-bot-sender-ids` (below), so none is reviewed by design. On a public
# repository that means the lane reviews only pull requests from branches of
# this repository: fork and Dependabot pull requests get no secrets.
#
# RUNNER PLACEMENT: hosted shape. This file runs the lane on the GitHub-hosted
# `ubuntu-24.04` runner, which the standards `runner-policy` component admits
# on a public repository. It is the hosted sibling of
# components/claude-lanes/claude-review.yml, which names the private fleet
# review label, and differs from it only in these comments, `runner` and the
# workflow `name:`, which is each file's stem in Title Case. The job id is the same, so
# the check context is the same on every target. A target manages one of the
# two, never both.
#
# INTERIM: this per-visibility pair is removed when the runner choice moves
# inside the ci-workflows reusable and runner-policy gains a cross-repo
# routing kind, so one caller serves both visibilities
# (distribution/sync-manifest.yml, the claude lane caller note).
# RUNNER PLACEMENT: hosted shape. Every job of pr-review-cli.yml runs on
# GitHub-hosted `ubuntu-24.04` (it takes no `runner` input), which the
# standards `runner-policy` component admits on a public repository. It is the
# hosted sibling of components/claude-lanes/claude-review.yml. The workflow
# `name:` is the destination file's stem in Title Case and the job id stays
# `pr-review`; this hosted caller reports `PR Review / Publish Review` (the
# fleet sibling still reports `PR Review / Claude` until private callers
# migrate, and the org's review-lane check lists accept both). A target manages
# one of the two, never both.
#
# This lane is advisory (github-iac ADR 0011: no organization ruleset may make
# an agentic review a merge prerequisite).
Expand Down Expand Up @@ -77,16 +74,14 @@ jobs:
# ready_for_review trigger above is what delivers one when it is ready.
if: github.event.pull_request.draft == false
permissions:
actions: read # check-key-credit reads its marker; Publish Review reads this workflow's runs
checks: read # Publish Review reads its earlier runs' cost notices
contents: read # checkout + read the diff
pull-requests: write # post review, tracking comment and the lane's
# reviewed-head marker comment
id-token: write # OIDC, mints the Claude GitHub App token (required
# even with an OAuth/API-key credential)
uses: melodic-software/ci-workflows/.github/workflows/pr-review.yml@main
pull-requests: write # post review, comments, and the lane's reviewed-head marker comment
uses: melodic-software/ci-workflows/.github/workflows/pr-review-cli.yml@main
with:
# Names (never the value) the fallback secret in the lane-outcome record.
fallback-credential-name: FALLBACK_CLAUDE_CODE_OAUTH_TOKEN
runner: ubuntu-24.04
lane: code
publish: comments
# Bot senders this lane reviews, by numeric user id: the
# automation-lanes App, so a commit it pushes to a pull request is
# reviewed. Where the repository does not set this variable the value is
Expand All @@ -102,9 +97,9 @@ jobs:
allowed-author-ids: '153232337'
# Pass only the named secrets (least privilege) rather than
# `secrets: inherit`, which would forward every parent secret to the
# called workflow.
# called workflow. The reviews role's API key runs first, then its
# subscription token after a handoff, then the central fallback subscription.
secrets:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
# The central fallback subscription: the review retries once on it after
# a usage limit on the token above.
CLAUDE_API_KEY: ${{ secrets.REVIEWS_CLAUDE_API_KEY }}
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.REVIEWS_CLAUDE_CODE_OAUTH_TOKEN }}
FALLBACK_CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.FALLBACK_CLAUDE_CODE_OAUTH_TOKEN }}
69 changes: 37 additions & 32 deletions .github/workflows/pr-review-security-hosted.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: PR Review Security Hosted

# SYNC-MANAGED FILE: DO NOT EDIT IN THE CONSUMING REPOSITORY.
# SYNC-MANAGED FILE — DO NOT EDIT IN THE CONSUMING REPOSITORY.
# Source of truth: melodic-software/standards,
# components/claude-lanes-hosted/claude-security-review.yml (the
# `claude-security-review-hosted-caller` component in
Expand All @@ -9,32 +9,35 @@ name: PR Review Security Hosted
# upstream, or move the component to `locally-owned` in the manifest to
# customize.
#
# Thin caller for the org's reusable security-review lane (advisory verdict,
# fail-closed execution check). The reusable workflow owns the action pin,
# model, and the secret-handling model; per its header, this caller owns the
# triggers, concurrency, and the GITHUB_TOKEN permission grant.
# Thin caller for the org's pr-review-cli reusable, lane `security` (advisory
# verdict, fail-closed execution check). The reusable workflow owns the
# launcher, the credential order (the reviews role's API key, then its
# subscription token after a handoff, then the central fallback subscription),
# and the secret-handling model; per its header, this caller owns the triggers,
# concurrency, and the GITHUB_TOKEN permission grant.
#
# There is no workflow-level path gating. The reusable skips, with a green
# check, a review whose files in scope are all documentation (its
# `docs-only-paths` default: `docs/**/*.md`, READMEs and changelogs). A
# There is no workflow-level path gating. `docs-only-paths` below skips, with
# a green check, a review whose files in scope are all documentation
# (`docs/**/*.md`, READMEs and changelogs), matching the legacy security
# reusable's default (pr-review-cli.yml defaults empty). A
# `.github/claude-security-paths` file has no effect.
#
# NEVER add workflow-level `paths:`/`paths-ignore:` to this caller: a check
# whose workflow never triggers is missing, not green, so a required check
# would stay Pending forever, and the babysit merge gate, which waits for
# `PR Review Security / Claude`, never arms.
# `PR Review Security / Publish Review`, never arms.
#
# The reusable skips fork PRs (they receive no secrets and a read-only token)
# and every `[bot]` actor whose sender id is not in `allowed-bot-sender-ids`
# (below); a required check does NOT prove a fork PR was reviewed (see the
# reusable's header). On a public repository the lane reviews only pull
# requests from branches of this repository: fork and Dependabot pull requests
# get no secrets.
# The reusable skips fork PRs (they receive no secrets and a read-only token),
# Dependabot, and every `[bot]` actor whose sender id is not in
# `allowed-bot-sender-ids` (below); a required check does NOT prove a fork PR
# was reviewed (see the reusable's header). On a public repository the lane
# reviews only pull requests from branches of this repository: fork and
# Dependabot pull requests get no secrets.
#
# RUNNER PLACEMENT: hosted shape, the sibling of
# components/claude-lanes/claude-security-review.yml, differing from it only
# in these comments, `runner` and the workflow `name:`. It is an interim with
# the same removal trigger as the code-review caller. See that file's header.
# RUNNER PLACEMENT: hosted shape. Every job of pr-review-cli.yml runs on
# GitHub-hosted `ubuntu-24.04` (it takes no `runner` input), which the
# standards `runner-policy` component admits on a public repository. It is the
# hosted sibling of components/claude-lanes/claude-security-review.yml.

on:
pull_request:
Expand All @@ -46,7 +49,7 @@ on:
# from making an agentic review a merge or deployment prerequisite. With
# the per-PR group below cancelling, a push supersedes the in-flight review.
#
# NO `merge_group:`: the pinned action cannot serve that event; see
# NO `merge_group:`: the reusable runs only on `pull_request`; see
# melodic-software/ci-workflows#272 before enabling a merge queue.
types: [opened, synchronize, ready_for_review, reopened]

Expand All @@ -70,26 +73,28 @@ jobs:
# ready_for_review trigger above is what delivers one when it is ready.
if: github.event.pull_request.draft == false
permissions:
actions: read # check-key-credit reads its marker; Publish Review reads this workflow's runs
checks: read # Publish Review reads its earlier runs' cost notices
contents: read # checkout + read the diff
pull-requests: write # post the security review, tracking comment and
# the lane's reviewed-head marker comment
id-token: write # OIDC, mints the Claude GitHub App token (required
# even with an OAuth/API-key credential)
uses: melodic-software/ci-workflows/.github/workflows/pr-review-security.yml@main
pull-requests: write # post the security review, comments, and the lane's reviewed-head marker comment
uses: melodic-software/ci-workflows/.github/workflows/pr-review-cli.yml@main
with:
# Names (never the value) the fallback secret in the lane-outcome record.
fallback-credential-name: FALLBACK_CLAUDE_CODE_OAUTH_TOKEN
runner: ubuntu-24.04
lane: security
publish: comments
docs-only-paths: |
docs/**/*.md
**/README.md
**/CHANGELOG.md
# Bot senders this lane reviews, by numeric user id: the
# automation-lanes App, so a commit it pushes to a pull request is
# reviewed. Where the repository does not set this variable the value is
# empty and the reusable reviews no bot.
allowed-bot-sender-ids: ${{ vars.AUTOMATION_LANES_APP_SENDER_ID }}
# Pass only the named secrets (least privilege) rather than
# `secrets: inherit`, which would forward every parent secret to the
# called workflow.
# called workflow. The reviews role's API key runs first, then its
# subscription token after a handoff, then the central fallback subscription.
secrets:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
# The central fallback subscription: the review retries once on it after
# a usage limit on the token above.
CLAUDE_API_KEY: ${{ secrets.REVIEWS_CLAUDE_API_KEY }}
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.REVIEWS_CLAUDE_CODE_OAUTH_TOKEN }}
FALLBACK_CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.FALLBACK_CLAUDE_CODE_OAUTH_TOKEN }}
Loading