Skip to content

chore: sync standards components #129

chore: sync standards components

chore: sync standards components #129

name: PR Review Security Hosted
# 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
# 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 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.
#
# 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
# `.github/claude-security-paths` file is no longer read.
#
# 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.
#
# 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.
#
# 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.
on:
pull_request:
# `synchronize`, matching the code-review lane: every push is re-reviewed,
# including the push that resolves a merge conflict (GitHub runs no
# pull_request workflow while a PR conflicts with its base), narrowed by
# the reusable to the files changed since the last completed review. The check
# stays advisory: github-iac ADR 0011 forbids any organization ruleset
# 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
# melodic-software/ci-workflows#272 before enabling a merge queue.
types: [opened, synchronize, ready_for_review, reopened]
permissions:
contents: read
# Per-PR supersede group: a newer event for the same PR, a push included,
# cancels the older run, so reviews of superseded heads do not stack. The
# merge guard judges only the newest run of each check, so a cancelled run on
# a superseded head does not block merge. The group is the
# `${{ github.workflow }}`-prefixed canonical form the standards
# `concurrency-policy` component requires.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
pr-review-security:
name: PR Review Security
# A draft is work in progress and does not spend a review; the
# ready_for_review trigger above is what delivers one when it is ready.
if: github.event.pull_request.draft == false
permissions:
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
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
# 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.
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.
FALLBACK_CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.FALLBACK_CLAUDE_CODE_OAUTH_TOKEN }}