From 0db9e83266e4142166a76bb5893531ff92b3d74a Mon Sep 17 00:00:00 2001 From: Conductor Adriaan Date: Thu, 29 Oct 2026 19:46:51 +0000 Subject: [PATCH 1/2] Describe the current pull request risk labeling in the README Co-Authored-By: Claude Opus 5.5 (1M context) --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d1aa836..e4880e2 100644 --- a/README.md +++ b/README.md @@ -4,28 +4,28 @@ This repo contains GitHub Action workflows that can be re-used by other apps. ## Pull request risk labels -Use the shared pull-request workflow to apply an SDLC risk label to every pull request. +Use the shared pull-request workflow to apply an SDLC risk label to every pull request. The calling repository needs access to an `ANTHROPIC_API_KEY` secret. ```yaml name: Pull Request on: pull_request: - types: [opened, reopened, synchronize] + types: [opened, reopened, synchronize, ready_for_review, labeled] jobs: pull-request: uses: simpleanalytics/github-actions/.github/workflows/pull-request.yml@main secrets: inherit - with: - internal_app: false ``` -When a PR has neither SDLC label, Claude reads the full PR diff and returns `change: routine` or `change: needs review` with a one-sentence reason, which the workflow applies and posts once. A `change: needs review` reason links to the lines of the most critical change. Later pushes skip Claude because an existing label is authoritative. If Claude returns no valid label, the workflow uses `change: routine`; if both labels are present, `change: needs review` wins. +On the first run, Claude reads the full PR diff and returns `change: routine` or `change: needs review` with a one-sentence reason. On later pushes, Claude only reads the changes since the last successful assessment, and earlier review triggers stay until a new diff removes them. The workflow posts the reason when the label changes; a `change: needs review` reason links to the lines of the most critical change. A label set by hand is kept as the assessment of the earlier code. If Claude returns an incomplete assessment, the run fails and leaves the labels unchanged. + +Draft PRs are skipped until they are ready for review. When a PR gets `change: needs review`, from Claude or by hand, the workflow requests a human reviewer. The prompt maps the four release risk levels of the Software Release and Deployment Procedure onto the two labels and includes notes per repository. Add a note to the prompt when a repository needs specific guidance. -Set `internal_app: true` for internal apps where changes that do not touch personal data or security should stay `change: routine`. The workflow defaults to `claude-sonnet-5-5`; override it with `claude_model`. +Set `internal_app: true` for an internal app without a repository note, so changes that do not touch personal data or security stay `change: routine`. The workflow defaults to `claude-haiku-5-5`; override it with `claude_model`. ## Deploy From 94ba4b9021538389ed9bc3475259e1c63f659dcd Mon Sep 17 00:00:00 2001 From: Conductor Adriaan Date: Thu, 29 Oct 2026 20:04:28 +0000 Subject: [PATCH 2/2] Pass only ANTHROPIC_API_KEY to the shared pull request workflow Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/pull-request-checks.yml | 3 ++- README.md | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request-checks.yml b/.github/workflows/pull-request-checks.yml index a934505..17e5842 100644 --- a/.github/workflows/pull-request-checks.yml +++ b/.github/workflows/pull-request-checks.yml @@ -7,4 +7,5 @@ on: jobs: pull-request: uses: ./.github/workflows/pull-request.yml - secrets: inherit + secrets: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} diff --git a/README.md b/README.md index e4880e2..edb30cf 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This repo contains GitHub Action workflows that can be re-used by other apps. ## Pull request risk labels -Use the shared pull-request workflow to apply an SDLC risk label to every pull request. The calling repository needs access to an `ANTHROPIC_API_KEY` secret. +Use the shared pull-request workflow to apply an SDLC risk label to every pull request. The calling repository needs access to an `ANTHROPIC_API_KEY` secret. Pass only that secret instead of `secrets: inherit`, so the shared workflow cannot receive unrelated credentials. ```yaml name: Pull Request @@ -16,7 +16,8 @@ on: jobs: pull-request: uses: simpleanalytics/github-actions/.github/workflows/pull-request.yml@main - secrets: inherit + secrets: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} ``` On the first run, Claude reads the full PR diff and returns `change: routine` or `change: needs review` with a one-sentence reason. On later pushes, Claude only reads the changes since the last successful assessment, and earlier review triggers stay until a new diff removes them. The workflow posts the reason when the label changes; a `change: needs review` reason links to the lines of the most critical change. A label set by hand is kept as the assessment of the earlier code. If Claude returns an incomplete assessment, the run fails and leaves the labels unchanged.