Skip to content

Grant pull-requests write permission to PR comment workflows - #390

Merged
jemacineiras merged 1 commit into
sngular:mainfrom
joseegman-idoneea:fix/ci-pr-comment-permissions
Jul 31, 2026
Merged

Grant pull-requests write permission to PR comment workflows#390
jemacineiras merged 1 commit into
sngular:mainfrom
joseegman-idoneea:fix/ci-pr-comment-permissions

Conversation

@joseegman-idoneea

Copy link
Copy Markdown
Contributor

What

Fixes the CI failure Error: Resource not accessible by integration raised by thollander/actions-comment-pull-request in the PR workflows.

Why

The PR workflows post comments (review label warnings, build/version warnings) but declare no permissions block, so they inherit the repository's default read-only GITHUB_TOKEN and cannot create/update PR comments. The "Pull Request Approved" workflow (pr-review.yml) fails on every approval at the check-labelsWarn about missing labels step:

Run thollander/actions-comment-pull-request@v2
No comment has been found with asked pattern. Creating a new comment.
Error: Resource not accessible by integration

maven-pr.yml and gradle-pr.yml share the same latent problem for release PRs.

Change

Add a minimal permissions block to the three PR workflows:

permissions:
  contents: read
  pull-requests: write
  • pr-review.yml — runs on pull_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

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>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@jemacineiras
jemacineiras merged commit 2e4e2cc into sngular:main Jul 31, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants