Skip to content

Migrate PR labeler away from pull_request_target - #785

Merged
tracyboehrer (tracyboehrer) merged 1 commit into
mainfrom
fix/pr-labeler-event-policy
Oct 28, 2026
Merged

tracyboehrer (tracyboehrer) merged 1 commit into
mainfrom
fix/pr-labeler-event-policy

Conversation

@tracyboehrer

@tracyboehrer tracyboehrer (tracyboehrer) commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Remove the repository's remaining pull_request_target trigger before GitHub begins enforcing the default blocking policy on December 2, 2026. This migration does not require an event-policy exception.

Changes

  • Add an unprivileged pull_request signal with no token permissions, covering opened, synchronized, and reopened PRs on all target branches.
  • Run the existing SHA-pinned labeler from the default branch using workflow_run, with write permissions scoped to the labeling job.
  • Discover current open PRs through paginated API queries matched to the triggering head SHA. Preserve synchronized path labels and From Fork, including when workflow metadata omits the PR association.
  • Never check out PR code, consume PR artifacts, or restore caches in the privileged workflow. Pass metadata through environment variables rather than interpolating it into shell scripts.

Validation by Copilot

Operational notes

The privileged workflow_run definition is loaded from the default branch, so the migrated end-to-end path activates after merge. A same-repository/fork labeling smoke test should follow merge. The signal follows GitHub's normal pull_request mergeability and approval rules.

Current credentials could not access Actions policy settings/insights (settings returned HTTP 403; the policy endpoint returned HTTP 404). Recent workflow runs confirmed that the existing labeler is active. No repository policies were changed.

Reference: GitHub's default policy and migration guidance.

Separate an unprivileged pull_request signal from an API-only workflow_run labeler. Preserve synchronized labels and fork attribution without executing PR code or consuming artifacts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 24ed5201-8ade-4f13-8cf5-4edb5c0fca3c
@tracyboehrer
tracyboehrer (tracyboehrer) merged commit 53ff58f into main Oct 28, 2026
11 checks passed
@tracyboehrer
tracyboehrer (tracyboehrer) deleted the fix/pr-labeler-event-policy branch October 28, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants