Grant pull-requests write permission to PR comment workflows - #390
Merged
jemacineiras merged 1 commit intoJul 31, 2026
Merged
Conversation
The PR workflows call thollander/actions-comment-pull-request to post review/build/label comments, but declare no permissions block, so they inherit the repository's default read-only GITHUB_TOKEN and fail with "Resource not accessible by integration" (e.g. the "Pull Request Approved" workflow when a PR is approved). Add a permissions block (contents: read, pull-requests: write) to pr-review.yml, maven-pr.yml and gradle-pr.yml so the comment steps can create/update comments. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
jemacineiras
approved these changes
Jul 31, 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.
What
Fixes the CI failure
Error: Resource not accessible by integrationraised bythollander/actions-comment-pull-requestin the PR workflows.Why
The PR workflows post comments (review label warnings, build/version warnings) but declare no
permissionsblock, so they inherit the repository's default read-onlyGITHUB_TOKENand cannot create/update PR comments. The "Pull Request Approved" workflow (pr-review.yml) fails on every approval at thecheck-labels→ Warn about missing labels step:maven-pr.ymlandgradle-pr.ymlshare the same latent problem for release PRs.Change
Add a minimal permissions block to the three PR workflows:
pr-review.yml— runs onpull_request_review(base-repo context), so the write scope now applies and the comment succeeds.maven-pr.yml,gradle-pr.yml— same block for consistency, fixing the comment steps for same-repo (release) PRs.No source or generated-code changes; project version is intentionally not bumped (CI-only change).
🤖 Generated with Claude Code