Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 16, 2025

The peer review workflow was failing with HTTP 403 "Resource not accessible by integration" when posting comments to PRs from forks. The pull_request trigger runs in the fork's context with read-only GITHUB_TOKEN permissions.

Changes:

  • Changed trigger from pull_request to pull_request_target in .github/workflows/check-peer-review.yml
  • Added security comment documenting no code checkout/execution occurs (API calls only)

The pull_request_target trigger runs in the base repo context, granting write permissions to post comments. This is safe since the workflow only makes GitHub API calls without executing PR code, following the same pattern as add-comment-count-label.yml.

Original prompt

please fix Posting comment to request peer review...
Failed to post comment. HTTP Code: 403, Response: {
"message": "Resource not accessible by integration",
"documentation_url": "https://docs.github.com/rest/issues/comments#create-an-issue-comment",
"status": "403"
}
Peer review check failed: No valid peer review found.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 16, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the unresolved-conversations: 0 PR has 0 unresolved conversations label Nov 16, 2025
@github-actions github-actions bot added the files-changed: 0 PR changes 0 files label Nov 16, 2025
Copilot AI changed the title [WIP] Fix issue with posting peer review comments Fix: Use pull_request_target to resolve 403 error in peer review check Nov 16, 2025
Copilot AI requested a review from DonnieBLT November 16, 2025 04:02
@DonnieBLT DonnieBLT marked this pull request as ready for review November 16, 2025 04:08
@DonnieBLT DonnieBLT merged commit 01a031b into main Nov 16, 2025
3 checks passed
@DonnieBLT DonnieBLT deleted the copilot/fix-peer-review-comment-issue branch November 16, 2025 04:08
@github-actions github-actions bot added files-changed: 1 and removed files-changed: 0 PR changes 0 files labels Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

files-changed: 1 unresolved-conversations: 0 PR has 0 unresolved conversations

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants