chore: add workflow to comment on fork pull requests#2810
Conversation
There was a problem hiding this comment.
🟡 Not ready to approve
The workflow as written is likely to fail posting the comment due to missing issues: write permission and should await the API call for reliable execution.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Adds a GitHub Actions workflow to automatically comment on newly opened fork-based pull requests, guiding contributors toward upstream-hosted branches to improve CI reliability.
Changes:
- Introduces a
pull_request_targetworkflow that runs on PR open events. - Posts an informational comment on fork PRs only (skips same-repo branches) via
actions/github-script.
File summaries
| File | Description |
|---|---|
.github/workflows/fork-pr-comment.yml |
New workflow that comments on fork PRs with instructions to join eic / ePIC Devs and open PRs from upstream branches. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Low
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
There was a problem hiding this comment.
🟡 Not ready to approve
The workflow likely lacks required issues: write permission for issues.createComment, and the posted message includes an overly absolute statement about fork PRs being unmergeable.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Review details
Comments suppressed due to low confidence (2)
.github/workflows/fork-pr-comment.yml:12
github.rest.issues.createCommentuses the Issues API; with fine-grainedGITHUB_TOKENpermissions, this typically requiresissues: write. Having onlypull-requests: writemay cause this workflow to fail with a 403 when trying to post the comment.
permissions:
pull-requests: write
.github/workflows/fork-pr-comment.yml:36
- The posted guidance says the fork PR "won't be able to be assessed and merged", which is stronger than what the workflow enforces and can be factually incorrect (fork PRs can still be reviewed/merged; the issue is CI reliability/permissions). Consider rephrasing to explain the limitation and that maintainers may request an upstream-hosted branch, rather than stating the PR cannot be merged.
'Since this pull request won't be able to be assessed and merged, you are welcome to close it when you have opened a new pull request from a branch in the repository.',
- Files reviewed: 1/1 changed files
- Comments generated: 0 new
- Review effort level: Low
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
Capybara summary for PR 2810
Last updated 2026-08-18T11:02-04:00 721074b |
There was a problem hiding this comment.
🟡 Not ready to approve
The new workflow likely lacks the required issues: write permission for issues.createComment, and it includes an unrelated clang-tidy config change plus misleading comment text.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Review details
Suppressed comments (3)
.github/workflows/fork-pr-comment.yml:13
- This job calls
github.rest.issues.createComment, which requiresissues: writepermission; with onlypull-requests: writethe API call will typically be denied ("Resource not accessible by integration"). Scope permissions toissues: writefor this workflow.
permissions:
pull-requests: write
if: github.event.pull_request.head.repo.full_name != github.repository
.github/workflows/fork-pr-comment.yml:36
- The comment text says fork PRs "won't be able to be assessed and merged", which is factually incorrect (fork PRs can still be reviewed/merged; the issue is CI reliability). Reword to avoid misleading contributors.
'Since this pull request won't be able to be assessed and merged, you are welcome to close it when you have opened a new pull request from a branch in the repository.',
.clang-tidy:18
- This PR is described as adding a fork-PR comment workflow, but it also disables
readability-braces-around-statementsin clang-tidy, which is an unrelated style/safety change. Consider reverting this line (or splitting it into a separate PR with rationale).
-readability-braces-around-statements,
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
8faaa4f to
89b34ea
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (2)
.clang-tidy:17
- This PR is described as adding a workflow for fork PR comments, but it also changes the clang-tidy configuration by disabling readability-braces-around-statements. If this is unintended or out of scope, revert it (or split/describe it in a separate change).
-readability-braces-around-statements,
.github/workflows/fork-pr-comment.yml:36
- The comment body states that a fork-based PR "won't be able to be assessed and merged", which is misleading: fork PRs can still be reviewed and merged, even if CI is less reliable due to permission restrictions. Consider rephrasing this line to focus on the CI reliability motivation rather than implying the PR cannot be merged.
'Since this pull request won't be able to be assessed and merged, you are welcome to close it when you have opened a new pull request from a branch in the repository.',
89b34ea to
742c2f4
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (2)
.github/workflows/fork-pr-comment.yml:12
github.rest.issues.createCommentuses the Issues API, but the workflow grants onlypull-requests: write. With explicit permissions, this can result in 403 errors when trying to create the comment. Grantissues: write(and droppull-requests: writeif it's not otherwise needed) so the workflow can post the comment reliably.
permissions:
pull-requests: write
.github/workflows/fork-pr-comment.yml:36
- The posted message states the fork PR "won't be able to be assessed and merged", which is stronger than the PR description (a nudge for CI reliability) and is not generally true on GitHub. Consider rephrasing to set expectations about CI reliability without asserting the PR cannot be reviewed/merged.
'Since this pull request won't be able to be assessed and merged, you are welcome to close it when you have opened a new pull request from a branch in the repository.',
ruse-traveler
left a comment
There was a problem hiding this comment.
Nice! Thanks for automating this @wdconinc! I think this'll be very helpful for new collaborators!
Co-authored-by: Derek M Anderson <derek.murphy.anderson@protonmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (2)
.github/workflows/fork-pr-comment.yml:13
github.rest.issues.createCommentuses the Issues API; with the currentpermissionsblock granting onlypull-requests: write, theGITHUB_TOKENmay not have sufficient scope to create the comment (it typically requiresissues: write). Addissues: write(and consider droppingpull-requests: writeif it's not needed) to prevent runtime 403s.
permissions:
pull-requests: write
if: github.event.pull_request.head.repo.full_name != github.repository
.github/workflows/fork-pr-comment.yml:36
- The posted message is currently absolute ("won't be able to be assessed and merged") and assumes the author is not already an org member. This contradicts the repo's contribution docs, which describe PR-based contributions generally (including draft PRs) without stating fork PRs cannot be reviewed/merged. Consider softening the language to set expectations about CI limitations without asserting the PR can't be merged, and phrase membership as conditional.
'Visit [github.com/eic](https://github.com/eic) for more information and instructions on how to join.',
'',
'Once you are a member, you will be able to push branches directly to this repository and open pull requests without needing a fork.',
'',
'Since this pull request won't be able to be assessed and merged, you are welcome to close it when you have opened a new pull request from a branch in the repository.',
Briefly, what does this PR introduce? Please link to any relevant presentations or discussions.
Adds a workflow that posts a comment on newly opened PRs (including drafts) submitted from forks, directing contributors to join the
eicorganization andePIC Devsteam via github.com/eic. CI reliability depends on PRs coming from upstream-hosted branches; this nudges fork contributors toward the preferred workflow.What is the urgency of this PR?
What kind of change does this PR introduce?
Please check if any of the following apply
AI assisted in drafting
.github/workflows/fork-pr-comment.yml. Usespull_request_target/openedso the workflow runs in the base-repo context (write access) even for fork PRs. Skips PRs from branches already insideeic/EICreconviaif: github.event.pull_request.head.repo.full_name != github.repository.