ci: label pull requests from a schedule, not pull_request_target #3353

Code

Clone this repository

Checkout

From your project repository, check out a new branch and test the changes.

git fetch -u origin "github-pr/3353:github-pr/3353"
git switch "github-pr/3353"
Open
leonida/mandy
sdelectron wants to merge 2 commits from github-pr/3353 into main

This branch is out-of-date with the base branch

Conversation
Reviewers 0 approvals
  • No reviewers
Details
This pull request is blocked because it's outdated.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'github-pr/3353:github-pr/3353'
git switch 'github-pr/3353'
sdelectron commented 2026-12-03 15:48:59 +00:00

Fixes the area-labels workflow, which has failed every run since Dec 2: GitHub's default blocks pull_request_target on public repositories, so all runs ended in startup_failure (run 47109744557; Neutron-0's finding in #3312).

The labeling now runs hourly from main, one actions/labeler run for every open pull request that may need a label, through the action's pr-number input (it takes several numbers, one per line). The job still runs from main with a token that can write to pull requests, and it still never checks out or runs pull request code.

The list job only hands over PRs opened or updated in the last 25 hours, or carrying no area: label yet and updated in the last 7 days, so a full pass doesn't spend the token's 1,000 requests/hour on PRs whose labels are already right; workflow_dispatch with label_all re-labels everything (manual, on-demand — at ~215 open PRs that's most of the hourly budget).

Trade-off: labels now lag up to an hour after a PR is opened or pushed, and a PR opened and merged within the hour never gets labels. There is no push trigger on purpose: a push to main changes no PR's file list.

claiming: CI-LABELER-TRUSTED-TRIGGER

Verified locally at upstream main 128579e9e: new tests/test_area_labels_workflow.py, 6 tests / 8 subtests pass (11 failures against the old workflow); neighboring workflow tests pass; jactionlint 2.6.0 + shellcheck clean; check_no_game_data clean. Reviewed by two independent read-only reviewers.

Fixes the area-labels workflow, which has failed every run since Dec 2: GitHub's default blocks `pull_request_target` on public repositories, so all runs ended in `startup_failure` (run 47109744557; Neutron-0's finding in #3312). The labeling now runs hourly from main, one actions/labeler run for every open pull request that may need a label, through the action's `pr-number` input (it takes several numbers, one per line). The job still runs from main with a token that can write to pull requests, and it still never checks out or runs pull request code. The list job only hands over PRs opened or updated in the last 25 hours, or carrying no `area:` label yet and updated in the last 7 days, so a full pass doesn't spend the token's 1,000 requests/hour on PRs whose labels are already right; workflow_dispatch with `label_all` re-labels everything (manual, on-demand — at ~215 open PRs that's most of the hourly budget). Trade-off: labels now lag up to an hour after a PR is opened or pushed, and a PR opened and merged within the hour never gets labels. There is no push trigger on purpose: a push to main changes no PR's file list. claiming: CI-LABELER-TRUSTED-TRIGGER Verified locally at upstream main 128579e9e: new `tests/test_area_labels_workflow.py`, 6 tests / 8 subtests pass (11 failures against the old workflow); neighboring workflow tests pass; jactionlint 2.6.0 + shellcheck clean; check_no_game_data clean. Reviewed by two independent read-only reviewers.
merzleckeier commented 2026-12-03 17:50:37 +00:00

Reviewed eef5f944 against main 0f0f268d. The merge is clean and all six area-label workflow tests passed on the same workflow and config.

[P2] A full relabel can report success with PRs left unlabeled. With no checkout, the pinned Labeler fetches the PR, its file list and the config for each number. When a label changes, it fetches the PR again and writes the labels. That is at least five REST requests per changed PR. The label_all input sends every open PR at once, so a change to the label rules can exceed the standard 1,000-request hourly limit at the current queue size. Pinned Labeler implementation · GitHub token rate limits

I ran the pinned bundle against a local stub with 214 synthetic PRs and one file each. Already-correct labels took 642 requests. Adding one label to each took 1,070 requests. At a simulated 1,000-request cap the action exited 0 after updating 200 of 214, because the subsequent pulls.get failures were treated as missing PRs. Consider fetching the trusted workflow-revision config once and giving label_all a way to resume a bounded batch. Pinned PR lookup

AI-assisted with OpenAI Codex. The budget test made no requests to GitHub.

Reviewed `eef5f944` against `main` `0f0f268d`. The merge is clean and all six area-label workflow tests passed on the same workflow and config. **[P2] A full relabel can report success with PRs left unlabeled.** With no checkout, the pinned Labeler fetches the PR, its file list and the config for each number. When a label changes, it fetches the PR again and writes the labels. That is at least five REST requests per changed PR. The `label_all` input sends every open PR at once, so a change to the label rules can exceed the standard 1,000-request hourly limit at the current queue size. [Pinned Labeler implementation](https://github.com/actions/labeler/blob/bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13/src/labeler.ts#L82-L140) · [GitHub token rate limits](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#primary-rate-limit-for-github_token-in-github-actions) I ran the pinned bundle against a local stub with 214 synthetic PRs and one file each. Already-correct labels took 642 requests. Adding one label to each took 1,070 requests. At a simulated 1,000-request cap the action exited 0 after updating 200 of 214, because the subsequent `pulls.get` failures were treated as missing PRs. Consider fetching the trusted workflow-revision config once and giving `label_all` a way to resume a bounded batch. [Pinned PR lookup](https://github.com/actions/labeler/blob/bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13/src/api/get-changed-pull-requests.ts#L8-L23) AI-assisted with OpenAI Codex. The budget test made no requests to GitHub.
Sign in to join this conversation.
No description provided.