Repository navigation
feat(github): a repository-scoped, read-only installation token - #302
Merged
Merged
Conversation
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… for the named repository ToolToken's token is private: grant() is the only way to hand it to a tool, and it sets GH_TOKEN and puts the token on the run's secrets in one step. The repository-id lookup checks the answer's full_name, so a rename that leaves the old name pointing elsewhere fails the mint instead of scoping it to another repository. The real-installation test fails when its variables are missing rather than passing without proof.
Merged
This was referenced Nov 14, 2026
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.
PR 2 of 4 for GitHub Actions workflow lockfiles (#300 was PR 1). Nothing calls the new token yet, so there's no behaviour change; PR 3 uses it.
crates/github/src/app.rs):POST /app/installations/{id}/access_tokenswith{"repository_ids": [<id>], "permissions": {"metadata": "read"}}. The token reads public repositories, as any authenticated caller can, and nothing private. The cache key becomes(installation, scope)with the same reuse window (until two minutes before expiry) and single-flight. The full-installation mint is unchanged: no body, byte for byte.GET /repos/{owner}/{name}with the installation token.Runner::actions_lock_token(repository)returns{ token, kind: Scoped | RunToken }. With App credentials it's the scoped token. On a bare-token run (the CLI withPATCHULA_TOKEN, the GitHub Action) it's the run's own token, as Renovate does; that was the user's decision.ToolTokenhas noDebug, and the token goes on the run'ssecretsfor masking.real_installation_scopes_a_token_to_one_repositoryis#[ignore]d and gated onPATCHULA_TEST_APP_ID,PATCHULA_TEST_APP_KEY_FILE,PATCHULA_TEST_INSTALLATION,PATCHULA_TEST_REPOandPATCHULA_TEST_OTHER_PRIVATE_REPO. It asserts the mintedpermissionsandrepositories, public reads, a 404 on another private repository, and a refused write. It hasn't been run yet: no App key is available in CI or to the agent. The run line is ininternals/github-client.md.crates/github/src/are bumped (all unreleased since perf(cache): extraction, catalog and notes state survive a release when their code did not change #293).Offline tests against the testkit's FakeGitHub cover the exact body, the honoured scope, cache reuse and renewal, per-repository separation, and the accessor's two kinds.
test:unitand clippy pass on the project VM.