Skip to content

Keep PR labels working without pull_request_target - #328

Merged
maximmaxim345 merged 2 commits into
mainfrom
ci/move-off-pull-request-target
Nov 26, 2026
Merged

maximmaxim345 merged 2 commits into
mainfrom
ci/move-off-pull-request-target

Conversation

@maximmaxim345

Copy link
Copy Markdown
Member

What does this implement/fix?

GitHub blocks the pull_request_target trigger by default in public repositories from 2 December 2026, so the PR labels need another trigger to keep working.

A new pr-event.yml runs on plain pull_request with no permissions and does nothing. Applying the release-notes label now listens for it with workflow_run, runs from main, and finds the PR through the API by its head commit, while the check for the ticked box stays on the PR without write access. On a fork PR from a first-time contributor, the check and the label now wait until a maintainer approves the workflow runs.

The same files are already on Sendspin/sendspin-js, where a PR from a fork (Sendspin/sendspin-js#252) got its label from the new job 20 seconds after it was opened.

Related issue (if applicable):

Types of changes

  • Bugfix (non-breaking change which fixes an issue): bugfix
  • New feature (non-breaking change which adds functionality): new-feature
  • Enhancement to an existing feature: enhancement
  • Breaking change (changes CLI options, settings, hooks or the protocol in a way that is not backwards compatible): breaking-change
  • Refactor (no behavior change): refactor
  • Documentation only: documentation
  • Maintenance / chore: maintenance
  • CI / workflow change: ci
  • Dependencies bump: dependencies

Copilot AI adaptive review requested due to automatic review settings November 26, 2026 10:59
@github-actions github-actions Bot added the ci Changes CI or GitHub workflows label Nov 26, 2026

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.

🟡 Changes recommended

Workflow queuing, premature check success, and ambiguous PR matching can leave release-notes labels missing or stale, potentially causing incorrect release classification.

3 open issues
What changed in this PR

Moves release-note labeling away from pull_request_target, preserving fork-PR support while separating checkbox validation from privileged label updates.

Changes:

  • Adds a permission-free PR notification workflow for workflow_run listeners.
  • Separates read-only verification from label application using trusted code.
  • Extracts label-selection rules and API-based PR lookup into reusable helpers.
File Description
.github/​workflows/​pr-labels.yaml Splits checkbox verification and privileged label application into separate jobs.
.github/​workflows/​pr-event.yml Notifies downstream workflows of PR events without granting permissions.
.github/​scripts/​pr-labels.cjs Selects release-note labels from checked boxes or existing labels.
.github/​scripts/​pr-event.cjs Finds the associated PR using its head repository, branch, and commit.

Review effort: Max (adaptive)

Comment thread .github/scripts/pr-event.cjs Resolved
Comment thread .github/workflows/pr-labels.yaml Resolved
Comment thread .github/workflows/pr-labels.yaml Resolved
@maximmaxim345
maximmaxim345 merged commit cadd991 into main Nov 26, 2026
7 checks passed
@maximmaxim345
maximmaxim345 deleted the ci/move-off-pull-request-target branch November 26, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Changes CI or GitHub workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants