Skip to content

chore: add workflow to comment on fork pull requests - #2810

Open
wdconinc with Copilot wants to merge 5 commits into
mainfrom
copilot/add-workflow-comment-new-prs
Open

chore: add workflow to comment on fork pull requests#2810
wdconinc with Copilot wants to merge 5 commits into
mainfrom
copilot/add-workflow-comment-new-prs

Conversation

Copilot AI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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 eic organization and ePIC Devs team 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?

  • High (please describe reason below)
  • Medium
  • Low

What kind of change does this PR introduce?

  • Bug fix (issue #__)
  • New feature (issue #__)
  • Optimization (issue #__)
  • Updated parameters, constants (issue #__)
  • Updated documentation
  • other: CI/workflow housekeeping

Please check if any of the following apply

  • This PR requires changes to geometry (epic PR: __)
  • This PR requires changes to EDM4eic (EDM PR: __)
  • This PR introduces breaking changes. Please describe changes users need to make below.
  • This PR changes default behavior. Please describe changes below.
  • AI was used in preparing this PR. Please describe usage below.

AI assisted in drafting .github/workflows/fork-pr-comment.yml. Uses pull_request_target / opened so the workflow runs in the base-repo context (write access) even for fork PRs. Skips PRs from branches already inside eic/EICrecon via if: github.event.pull_request.head.repo.full_name != github.repository.

@wdconinc
wdconinc marked this pull request as ready for review July 29, 2026 19:10
@wdconinc
wdconinc requested review from a team and Copilot July 29, 2026 19:10
Comment thread .github/workflows/fork-pr-comment.yml
@wdconinc
wdconinc requested a lite review from Copilot and removed request for Copilot July 29, 2026 19:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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_target workflow 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.

Comment thread .github/workflows/fork-pr-comment.yml
Comment thread .github/workflows/fork-pr-comment.yml Outdated
Copilot AI review requested due to automatic review settings July 29, 2026 19:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Copilot AI review requested due to automatic review settings July 29, 2026 19:31
@wdconinc
wdconinc enabled auto-merge July 29, 2026 19:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.createComment uses the Issues API; with fine-grained GITHUB_TOKEN permissions, this typically requires issues: write. Having only pull-requests: write may 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.

Copilot AI review requested due to automatic review settings August 4, 2026 13:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 requires issues: write permission; with only pull-requests: write the API call will typically be denied ("Resource not accessible by integration"). Scope permissions to issues: write for 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-statements in 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.

wdconinc and others added 2 commits August 17, 2026 21:47
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 18, 2026 02:47
@wdconinc
wdconinc force-pushed the copilot/add-workflow-comment-new-prs branch from 8faaa4f to 89b34ea Compare August 18, 2026 02:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.',

Copilot AI review requested due to automatic review settings August 18, 2026 03:09
@wdconinc
wdconinc force-pushed the copilot/add-workflow-comment-new-prs branch from 89b34ea to 742c2f4 Compare August 18, 2026 03:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.createComment uses the Issues API, but the workflow grants only pull-requests: write. With explicit permissions, this can result in 403 errors when trying to create the comment. Grant issues: write (and drop pull-requests: write if 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.',

Copilot AI review requested due to automatic review settings August 18, 2026 13:38

This comment was marked as low quality.

ruse-traveler
ruse-traveler previously approved these changes Aug 18, 2026

@ruse-traveler ruse-traveler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for automating this @wdconinc! I think this'll be very helpful for new collaborators!

Comment thread .github/workflows/fork-pr-comment.yml Outdated
Co-authored-by: Derek M Anderson <derek.murphy.anderson@protonmail.com>
Copilot AI review requested due to automatic review settings August 18, 2026 16:53
@wdconinc
wdconinc enabled auto-merge August 18, 2026 16:53
@wdconinc
wdconinc requested a review from ruse-traveler August 18, 2026 16:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.createComment uses the Issues API; with the current permissions block granting only pull-requests: write, the GITHUB_TOKEN may not have sufficient scope to create the comment (it typically requires issues: write). Add issues: write (and consider dropping pull-requests: write if 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.',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants