ci: fix claude action severity labeling#10548
Closed
Roasbeef wants to merge 1 commit intolightningnetwork:masterfrom
Closed
ci: fix claude action severity labeling#10548Roasbeef wants to merge 1 commit intolightningnetwork:masterfrom
Roasbeef wants to merge 1 commit intolightningnetwork:masterfrom
Conversation
The claude-code-action's default allowed tools only include gh pr view/edit/comment, but Claude was choosing gh api to add labels, which gets denied. Additionally, the GitHub token permissions were read-only for issues and pull-requests, so even if the tool call succeeded the API request would fail with a 403. Grant write permissions for issues and pull-requests, and add a prompt instruction that tells Claude to use gh pr edit --add-label instead of gh api for label operations.
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
Member
Author
|
Closing - the pr-severity.yml workflow already handles this correctly. The permission denial was benign (Claude retried with the allowed tool). |
Collaborator
🟢 PR Severity: LOW
🟢 Low (1 file)
AnalysisThis PR modifies only the Claude GitHub Actions workflow configuration (
The change appears to fix the severity labeling logic in the Claude action itself, which is a meta-improvement to the CI process. To override, add a |
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.
The Claude Code GitHub Action was failing to add severity labels to PRs. The root cause was a permission denial at two levels: Claude was using
gh apito hit the issues labels endpoint, but the action's default allowed tools only permitgh pr view,gh pr edit, andgh pr comment. So the tool call was rejected before it ever reached GitHub.Even if the tool call had gone through, it would have failed anyway. The workflow's GitHub token permissions were set to read-only for both
issuesandpull-requests, meaning any write operation against the labels API would return a 403.This change bumps the
issuesandpull-requestspermissions towriteso the token can actually modify labels. It also adds a prompt instruction telling Claude to usegh pr edit --add-labelfor labeling instead ofgh api, which keeps the allowed tools as restricted as possible without needing to open up arbitrary API access.The failed run that surfaced this: https://github.com/lightningnetwork/lnd/actions/runs/21614145381/job/62289184152. You can see in the output that the
gh apicall shows up in thepermission_denialsarray, confirming the tool was blocked by Claude Code's own sandboxing before the GitHub API was ever contacted.