Repository navigation
Let the label check read a pull request's labels - #1803
Open
jgautheron wants to merge 1 commit into
Open
jgautheron wants to merge 1 commit into
jgautheron wants to merge 1 commit into
Conversation
check-pr-labels fails on every pull request with "Resource not accessible by integration". Its job-level permissions block names only issues, and a job-level block zeroes every scope it does not list, so the pull-requests scope that reading a pull request's labels needs is absent. sync-labels is unaffected because it inherits the workflow-level block, which grants both.
Collaborator
|
/kelos review |
Contributor
|
🤖 Kelos Task Status Task |
Contributor
|
🤖 Kelos Reviewer Agent @gjkim42 Review SummaryVerdict: APPROVE Findings Overview
FindingsAccuracy
Key takeaways
|
This branch is waiting to be deployed
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 type of PR is this?
/kind bug
What this PR does / why we need it:
check-pr-labelsfails on every pull request withResource not accessible by integration, so the check never actually evaluates the blocking labels it exists to enforce.The job declares:
A job-level
permissionsblock replaces the workflow-level one and sets every scope it does not name tonone. Reading a pull request's labels requires thepull-requestsscope, soissues.listLabelsOnIssuehas no scope that permits it — the call is unauthorized by construction, regardless of repository settings.The sibling
sync-labelsjob is unaffected because it has no job-level block and inherits the workflow-levelissues: write+pull-requests: write.Adding
pull-requests: readalongsideissues: readfixes it without widening anything else.Which issue(s) this PR is related to:
N/A
Special notes for your reviewer:
The check is red on every pull request. It reproduces anywhere the workflow runs on a pull request, since it comes from the job's own permissions rather than from a repository setting.
Does this PR introduce a user-facing change?
Summary by cubic
Fixes the
check-pr-labelsjob so it can actually read a pull request's labels instead of failing every time withResource not accessible by integration.The job's own
permissionsblock only grantedissues: read, and a job-level block sets every scope it doesn't name tonone. Reading a pull request's labels requires thepull-requestsscope, so the call was unauthorized by construction. Addingpull-requests: readalongsideissues: readfixes it without widening any other scope.sync-labelsis unaffected because it has no job-level block and inherits the workflow-level permissions.Written for commit b0f6890. Summary will update on new commits.