Draft
Conversation
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.
Summary
Replaces the GraphQL
repository.collaboratorspermission check in lockdown mode with the REST GetPermissionLevel endpoint, and addgithub-actions[bot]to the trusted bots list.Lockdown filtering behaviour is preserved; same trust model (push access = trusted), same fail-closed error handling.
Why
Lockdown mode filters issue and PR content on public repos based on whether the author has push access to the repository. It does this using the GraphQL
repository.collaboratorsfield, but this field requires the calling token to have admin/write access on the repo to enumerate collaborators.GITHUB_TOKENand GitHub App installation tokens typically don't have this, so the query silently returns empty results (no error), and lockdown ends up treating every author as untrusted, blocking all content.The REST
GetPermissionLevelendpoint works with any authenticated token and returns the exact permission level.What changed
GetPermissionLevelfor permission checks (kept GraphQL for repo metadata only:viewer.login,isPrivate)restClientas a positional parameter onGetInstanceand wired it throughNewRepoAccessCacheconstructor for test isolationgithub-actions[bot]to trustedBotLoginsisTrustedBotcheck before API calls inIsSafeContentto skip unnecessary lookups for trusted botsMCP impact
Security / limits
GetPermissionLevelrequires onlymetadata: read(included by default on all token types as far as I know) and works with any authenticated token on public repos.Tool renaming
deprecated_tool_aliases.goLint & tests
./script/lint./script/testDocs