ci(pr): restore PR labeling for internal PRs#21962
Open
overlookmotel wants to merge 1 commit intomainfrom
Open
ci(pr): restore PR labeling for internal PRs#21962overlookmotel wants to merge 1 commit intomainfrom
overlookmotel wants to merge 1 commit intomainfrom
Conversation
Member
Author
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
There was a problem hiding this comment.
Pull request overview
Restores automatic PR labeling in the PR workflow for internal (same-repo) pull requests, while keeping PR-title validation on the safer pull_request event (avoiding pull_request_target).
Changes:
- Reintroduce
actions/labelerto apply labels on internal PRs only (skip forks). - Add job-level permissions needed for labeling (
contents: read,pull-requests: write). - Rename the job to reflect both labeling and title validation responsibilities.
ad9aabe to
da2cf54
Compare
6fcce17 to
8653bf4
Compare
da2cf54 to
35d7e8e
Compare
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.

#21566 removed PR labelling for security reasons - it used
pull_request_targetevent, which is a security hazard.I noticed its absense, and missed it! Have been labelling all my PRs by hand.
Restore PR labelling only for "internal" PRs. This can work with
pull_requesttarget.I've added it as a separate workflow
pr-label.yml, instead of adding it back to thepr.ymlworkflow, so that thepull-requests: writepermission is scoped just to the job that needs it. "Check PR Title" doesn't need this permission.Claude tells me we could also support labelling external PRs by using
workflow_runevent instead:But I'm not confident enough in what he's saying, or in my own GitHub Actions chops, to propose that. So this is a "middle way" which I think is less risky.