Skip to content

ci(labeler): fix the labeler token and use canonical label names - #6

Open
ss-o wants to merge 2 commits into
mainfrom
ci/labeler-default-token
Open

ci(labeler): fix the labeler token and use canonical label names#6
ss-o wants to merge 2 commits into
mainfrom
ci/labeler-default-token

Conversation

@ss-o

@ss-o ss-o commented Aug 19, 2026

Copy link
Copy Markdown
Member

Two related fixes to the pull request labeler, kept together deliberately.

1. The labeler could never authenticate

repo-token came from secrets.GH_PAT, which is not populated, so actions/labeler failed before reading any configuration:

##[error]Error: Parameter token or opts.auth is required

No PAT is needed. The job already declares pull-requests: write, the only permission actions/labeler requires for a same-repository pull request, so the default GITHUB_TOKEN is sufficient and drops a long-lived credential dependency.

2. The config named labels that no longer exist

.github/labeler.yml referenced legacy labels that z-shell/.github#467 deleted across the organization:

Was Now
documentation πŸ“ type:docs
dependencies πŸ“¦ area:dependencies
enhancement ✨ type:maintenance
maintenance πŸ“ˆ type:maintenance
annex πŸŒ€ / plugin βš™οΈ / package πŸ“¦ area:annex / area:plugin / area:package
ci πŸ€– area:ci
i18n 🌐 removed

Why both in one pull request

These must not land separately. actions/labeler applies labels through the issues API, which creates a label that does not exist rather than failing. Fixing the token alone would make the labeler start working while it still names deleted labels, resurrecting them on the next matching pull request and undoing the org-wide cleanup. Fixing the config alone leaves the labeler broken. Together they are safe in either merge order.

Two notes on the config change:

  • enhancement ✨ and maintenance πŸ“ˆ both map to type:maintenance, so their glob lists merge into one key rather than being renamed one for one.
  • i18n 🌐 is dropped, not translated. It has no canonical equivalent and this repository has never used it. The only repository in the organization that does is z-shell/wiki, which does not drive it from a labeler config. It arrived here from a Docusaurus-shaped template, which is also why the config carried crowdin.yml and i18n/** globs for paths this repository does not have.

Verified before fan-out

Piloted in z-shell/z-a-submods. After the identical changes merged, z-a-submods#7 was the first pull request to run against them: the triage check succeeded where every previous run had failed, and the labeler applied area:ci, correctly matched and canonical.

The triage check on this pull request is still expected to fail, because pull_request_target runs the workflow from the base branch, which still has the broken token. That is not a regression and not a reason to hold the merge; the fix takes effect for the first pull request opened after this merges.

Part of z-shell/.github#527.

ss-o added 2 commits August 19, 2026 03:13
The labeler job passes repo-token from secrets.GH_PAT, which is not populated,
so actions/labeler exits with "Parameter token or opts.auth is required" before
reading any configuration. The workflow has therefore never applied a label.

No PAT is needed. The job already declares pull-requests: write, the only
permission actions/labeler requires for a same-repository pull request, so the
default GITHUB_TOKEN is sufficient and avoids a long-lived credential.

Verified in z-shell/z-a-submods#7: after the same change, the labeler ran to
completion and applied the correct canonical label.

Refs z-shell/.github#527
The config named legacy labels that z-shell/.github#467 deleted org-wide. Now
that the labeler can authenticate again, those names would be applied for real,
and actions/labeler creates a label that does not exist rather than failing, so
the deleted legacy labels would come straight back.

Map each key to its lib/labels.yml replacement and drop the i18n key, which this
repository has never used; it arrived from a Docusaurus-shaped template along
with the crowdin and docusaurus globs.

enhancement and maintenance both map to type:maintenance, so their glob lists
merge into one key rather than being renamed one for one.

Refs z-shell/.github#527
@ss-o ss-o changed the title ci(labeler): use the default GITHUB_TOKEN instead of an unset PAT ci(labeler): fix the labeler token and use canonical label names Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant