Migrate pull request automation away from pull_request_target - #22321
Open
mrecachinas wants to merge 3 commits into
Open
Migrate pull request automation away from pull_request_target#22321mrecachinas wants to merge 3 commits into
mrecachinas wants to merge 3 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates PR automation from pull_request_target to lower-privilege workflows with a validated privileged labeling stage.
Changes:
- Splits label detection and application across
pull_requestandworkflow_run. - Validates PR identity and head commit before labeling.
- Runs change-note checks with read-only permissions.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/labeler.yml |
Adds the unprivileged labeling trigger. |
.github/workflows/labeler-apply.yml |
Validates and labels the associated PR. |
.github/workflows/check-change-note.yml |
Migrates change-note checks to pull_request. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Balanced
Replace the fork-approval-gated dispatcher with frequent trusted scheduled reconciliation and stable hourly recovery shards. Revalidate each open pull request and head SHA immediately before applying labels without checking out pull request code. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 512eb347-ec89-4250-8bf1-87048974b01d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate the repository's remaining pull request automation away from
pull_request_targetwithout executing pull request code in a privileged context.pull_requestwith read-only permissions.The labeler only checks out
.github/labeler.ymlfrom the default branch. It treats pull request numbers, head SHAs, and changed filenames as data and never checks out or executes pull request code. This covers unapproved fork PRs and conflicted PRs, neither of which can reliably dispatch apull_requestworkflow.Validation
actionlinton both modified workflows (excluding the pre-existingactions/labeler@v4Node runtime warning)git diff --checkThis is workflow-only infrastructure, so the PR has the
no-change-note-requiredlabel.