Repository navigation
ci: trigger the PR labeler on pull_request - #293
Merged
Merged
Conversation
GitHub now blocks pull_request_target on public repositories by default, so every Auto Label PR run ended in a startup failure before any job was created. Labeling does not need that trigger for pull requests opened from a branch in this repository, so run on pull_request instead. A pull request from a fork always gets a read-only token under pull_request, so the job skips those rather than fail. They need labeling by hand. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
MarTrepodi
enabled auto-merge
December 5, 2026 00:50
MarTrepodi
disabled auto-merge
December 5, 2026 00:59
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.
Description
Every
Auto Label PRrun since December 2 has ended in a startup failure, so no pull request has been labeled by path since then. GitHub now blockspull_request_targeton public repositories by default, and this workflow was the only one here using that trigger.Labeling does not need
pull_request_targetfor pull requests opened from a branch in this repository, so the workflow moves topull_requestand the default protection stays in place.Summary
What each kind of pull request gets after this change:
pull_requestpermissionsblockpermissionsblockTwo of the 223 pull requests so far came from forks. Without the
if, the labeler would fail on those instead of skipping.One behaviour shift: under
pull_requestthe workflow file and.github/labeler.ymlcome from the pull request's merge commit rather than the base branch, so a pull request that edits the label rules is labeled by its own new rules.Related Issues
None.
Type of Change
Checklist
developbranch (only release PRs targetmain)feat:,fix:,refactor:, etc.) — they become the changelogCHANGELOG.mdby hand (it is generated from commit messages)README.md,docs/,examples/) if user-facing behavior changed — not applicableuv run pytest tests/) — not run locally; no Python changeduv run ruff check src/ tests/anduv run ruff format --check src/ tests/) — not run locally; no Python changeduv run ty check src/swgoh_comlink/) — not run locally; no Python changedTesting
Before: the last four runs, on feat: v2.10 improvements #290, chore(release): v2.10.0 #291 (twice) and chore: back-merge main into develop #292, each stopped before any job was created:
Example: https://github.com/swgoh-utils/comlink-python/actions/runs/47455499509
After: the labeler run on this pull request used the workflow file from this branch, passed, and applied the
cilabel:https://github.com/swgoh-utils/comlink-python/actions/runs/47457191300
This pull request also shows one more blocked
pull_request_targetrun. GitHub reads that trigger from the default branch, so the old workflow onmainkeeps firing, and failing at startup, on every pull request until this change reachesmainwith the next release. Those runs do not appear as checks on the pull request.The pre-commit hooks (
check yaml,commitlint) pass on the commit.Not exercised: a pull request from a fork. The skip relies on the
ifcondition alone.Merge Danger
Door: two-way
One workflow file. Reverting restores the old trigger, which GitHub would block again.
Blast Radius: labels
Only the path labels on pull requests are affected, and no other workflow or required check depends on them. Pull requests from forks stop being labeled automatically. Pull requests that target
mainstay unlabeled untilmainhas this change, because their merge commit still carries the old workflow file.🤖 Generated with Claude Code