ci: label pull requests from workflow_run instead of pull_request_target #7482
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.43) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 385 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.356
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #7482"
general
weight: 0.35
comphead
Which issue does this PR close?
Closes #7475.
Rationale for this change
GitHub blocks the
pull_request_targettrigger by default on public repositories from December 2, 2026, with brownouts before then, and ASF infra is disabling it for ASF repositories.label_prs.ymlruns on that trigger, so pull requests would stop getting their type and path labels. Upstream tracking issue: apache/datafusion#26406.What changes are included in this PR?
The labeler is split into two workflows:
label_prs_trigger.yml(new) runs onpull_requestforopened,synchronizeandreopened, the same events as before. It haspermissions: {}and does nothing. It exists only so its completion can start the labeler.label_prs.ymlnow runs onworkflow_runwhen the trigger workflow completes.workflow_runalways runs the default branch's copy of the file with the repository token, so it can write labels on fork pull requests. It:- finds the open pull request whose head repository, branch and commit match the triggering run. Nothing produced by the PR's run is read, so there is no artifact to trust. If the head has moved on, the run for the newer push labels the PR instead.
- applies the type label from the title with the existing
dev/ci/pr-type-label.mjs, read from the default branch checkout. Dependabot PRs are still skipped.- applies the path labels with
actions/labeler@v7, passing the PR through itspr-numberinput.- keeps the per-PR concurrency group with cancellation, now keyed on the head repository and branch because
workflow_rundoesn't carry the PR number. It also adds a repository guard so the workflow doesn't run in forks.The standalone workflow table in
.github/workflows/README.mdis updated to match.Behavior changes:
maininstead of from their base branch.pull_request, a first-time contributor's trigger run may wait for maintainer approval, depending on the repository's Actions settings. Their PR may not be labelled until a maintainer approves the run.branch-1.2still runslabel_prs.ymlonpull_request_target. After this merges, it needs a backport that addslabel_prs_trigger.ymlthere and removes itslabel_prs.yml. Apull_requestrun uses the workflow files from the PR's base branch, but the labeler onmainpicks up the trigger run from any branch.How are these changes tested?
python3 dev/ci/check-ci-config.pyandactionlintpass on both workflows.node --test dev/ci/pr-type-label.test.mjsstill passes. The title logic is unchanged.GET /pulls?state=open&head=<owner>:<branch>returns #7477 with the expected head SHA and repository.workflow_runonly fires from the default branch's copy of a workflow, so this can't be tested end to end until it merges. After merge, opening or pushing to any PR should startLabel pull requests triggerand thenLabel pull requests, and the PR should get its labels.