infra: install Claude GitHub App, locked to one account - #3
Merged
Merged
Conversation
/install-github-app's own secret-write step 403'd — the box's fine-grained PAT has push/admin but not the separate Actions-secrets permission block. Committing the workflow directly (push works fine); the ANTHROPIC_API_KEY secret still needs to be added by hand in Settings -> Secrets and variables -> Actions, since that's cleaner than widening the PAT's scope for it. Gated to github.event.*.user.id == 103786821 (idIing's numeric GitHub id, not the login string) on top of the action's own built-in write-access check, so no other collaborator's @claude mention can spend this repo's API usage, and a future username change needs no edit here. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
.github/workflows/claude.ymlfrom the officialanthropics/claude-code-actionsetup guide, so@claudeon an issue/PR comment triggers a Claude Code review under its own GitHub App identity — separate from any commit made with this box's own PAT.Why manual, not
/install-github-appThat command's own secret-write step 403'd on this repo: the box's fine-grained PAT has
push/adminbut not the separate Actions-secrets write permission. Rather than widen the PAT's scope for a one-time write, this PR just commits the workflow file (a normal push); theANTHROPIC_API_KEYsecret still needs to be added by hand.Access lock
The job condition checks
github.event.*.user.id == 103786821—idIing's numeric GitHub account id, not the login string — on top of the action's own built-in write-access requirement. Two effects:@claudemention can trigger a run and spend this repo's API usage.Still needed before this does anything
Repo Settings -> Secrets and variables -> Actions -> New repository secret:
ANTHROPIC_API_KEY(orCLAUDE_CODE_OAUTH_TOKEN). Neither this PR nor this box ever holds that value.🤖 Generated with Claude Code