Skip to content

Harden fork PR auto-close workflow and align contributor guidance#14

Open
marilene38 with Copilot wants to merge 2 commits into
mainfrom
copilot/review-file-changes
Open

Harden fork PR auto-close workflow and align contributor guidance#14
marilene38 with Copilot wants to merge 2 commits into
mainfrom
copilot/review-file-changes

Conversation

Copilot AI commented Mar 1, 2026

Copy link
Copy Markdown

At the moment we are not accepting contributions to the repository.

The workflow review requested tighter fork-PR handling and clearer contributor messaging. This update keeps behavior focused on fork PR auto-closure while reducing permission scope and documenting the policy link used in the close comment.

  • Workflow scope and triggers (.github/workflows/auto-close-pr.yml)

    • Added synchronize to pull_request_target event types.
    • Removed unnecessary issues: write permission.
    • Moved fork/open/already-labeled checks to job-level if for clearer execution gating.
    • Removed author_association == 'NONE' restriction so all fork PRs are handled consistently.
    • Added explicit PR_NUMBER presence check before running gh commands.
  • Contributor guidance in close comment

    • Extended the close message with a direct repository policy link:
      • https://github.com/github/CopilotForXcode#contributing-feedback
    • Retained Copilot community discussion link for feedback routing.
  • Documentation alignment (README.md)

    • Added Contributing Feedback section to match workflow messaging and provide a stable reference target.
on:
  pull_request_target:
    types: [opened, reopened, synchronize]

permissions:
  pull-requests: write

jobs:
  close:
    if: >-
      github.event.pull_request.head.repo.full_name != github.repository &&
      github.event.pull_request.state == 'open' &&
      !contains(github.event.pull_request.labels.*.name, 'auto-closed')

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: marilene38 <135267736+marilene38@users.noreply.github.com>
Copilot AI changed the title [WIP] Review changes in specified file Harden fork PR auto-close workflow and align contributor guidance Mar 1, 2026
@marilene38
marilene38 requested review from Copilot and marilene38 March 1, 2026 21:52
@marilene38
marilene38 marked this pull request as ready for review March 1, 2026 21:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens the repository’s fork PR auto-closure behavior and aligns contributor-facing messaging by linking to a stable “Contributing Feedback” section in the README.

Changes:

  • Updates the auto-close workflow to also run on pull_request_target.synchronize, simplifies gating via a job-level if, and removes the author_association restriction.
  • Extends the auto-close comment with a direct link to the repository’s contribution/feedback policy section.
  • Adds a “Contributing Feedback” section in README.md to serve as the stable reference target.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/auto-close-pr.yml Expands trigger coverage and adjusts gating/permissions while updating the close message to include a policy link.
README.md Adds a “Contributing Feedback” section intended to match the workflow’s guidance and provide a stable anchor link.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
## Contributing Feedback

We currently do not accept pull requests to this repository. Please share ideas,
questions, and bug reports through the [Copilot community

Copilot AI Mar 1, 2026

Copy link

Choose a reason for hiding this comment

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

The new README section routes feedback exclusively to Discussions, but the auto-close workflow message now says the project accepts "issues and discussions". To keep contributor guidance consistent (and keep the README anchor link accurate), update this section to match the workflow message (or update the workflow message to match the README).

Suggested change
questions, and bug reports through the [Copilot community
questions, and bug reports through GitHub issues or the [Copilot community

Copilot uses AI. Check for mistakes.
types: [opened, reopened, synchronize]

permissions:
pull-requests: write

Copilot AI Mar 1, 2026

Copy link

Choose a reason for hiding this comment

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

The workflow still creates labels and adds a label to the PR (and posts a PR comment via gh pr close --comment), which uses the Issues API. With issues: write removed, these gh label create, gh pr edit --add-label, and the close comment are likely to fail with permission errors. Either add issues: write back, or adjust the workflow to avoid label/comment operations that require it.

Suggested change
pull-requests: write
pull-requests: write
issues: write

Copilot uses AI. Check for mistakes.
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.

3 participants