Skip to content

ci(pr): restore PR labeling for internal PRs#21962

Open
overlookmotel wants to merge 1 commit intomainfrom
om/04-30-ci_pr_restore_pr_labeling
Open

ci(pr): restore PR labeling for internal PRs#21962
overlookmotel wants to merge 1 commit intomainfrom
om/04-30-ci_pr_restore_pr_labeling

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Apr 30, 2026

#21566 removed PR labelling for security reasons - it used pull_request_target event, 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_request target.

I've added it as a separate workflow pr-label.yml, instead of adding it back to the pr.yml workflow, so that the pull-requests: write permission 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_run event instead:

workflow_run runs in base-repo context with a write token, and avoids pull_request_target's privileged-context hazard.

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.

Copy link
Copy Markdown
Member Author

overlookmotel commented Apr 30, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of 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.

@overlookmotel overlookmotel changed the title ci(pr): restore PR labeling ci(pr): restore PR labeling for internal PRs Apr 30, 2026
@overlookmotel overlookmotel marked this pull request as ready for review April 30, 2026 00:19
@overlookmotel overlookmotel requested review from Boshen and Copilot April 30, 2026 00:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/labeler to 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.

Comment thread .github/workflows/pr.yml Outdated
@overlookmotel overlookmotel changed the base branch from om/04-30-ci_pr_ignore_graphite-base_branches to graphite-base/21962 April 30, 2026 13:53
@overlookmotel overlookmotel force-pushed the om/04-30-ci_pr_restore_pr_labeling branch from ad9aabe to da2cf54 Compare April 30, 2026 13:53
@overlookmotel overlookmotel changed the base branch from graphite-base/21962 to main April 30, 2026 13:53
@overlookmotel overlookmotel force-pushed the om/04-30-ci_pr_restore_pr_labeling branch from da2cf54 to 35d7e8e Compare April 30, 2026 13:55
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