Repository navigation
Keep PR labels working without pull_request_target - #328
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 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_runlisteners. - 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)
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.

What does this implement/fix?
GitHub blocks the
pull_request_targettrigger by default in public repositories from 2 December 2026, so the PR labels need another trigger to keep working.A new
pr-event.ymlruns on plainpull_requestwith no permissions and does nothing. Applying the release-notes label now listens for it withworkflow_run, runs frommain, 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):
pull_request_targetbefore 2 December music-assistant/backlog#589Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocumentationmaintenancecidependencies