ci(labeler): fix the labeler token and use canonical label names - #6
Open
ss-o wants to merge 2 commits into
Open
ci(labeler): fix the labeler token and use canonical label names#6ss-o wants to merge 2 commits into
ss-o wants to merge 2 commits into
Conversation
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
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.
Two related fixes to the pull request labeler, kept together deliberately.
1. The labeler could never authenticate
repo-tokencame fromsecrets.GH_PAT, which is not populated, soactions/labelerfailed before reading any configuration:No PAT is needed. The job already declares
pull-requests: write, the only permissionactions/labelerrequires for a same-repository pull request, so the defaultGITHUB_TOKENis sufficient and drops a long-lived credential dependency.2. The config named labels that no longer exist
.github/labeler.ymlreferenced legacy labels that z-shell/.github#467 deleted across the organization:documentation πtype:docsdependencies π¦area:dependenciesenhancement β¨type:maintenancemaintenance πtype:maintenanceannex π/plugin βοΈ/package π¦area:annex/area:plugin/area:packageci π€area:cii18n πWhy both in one pull request
These must not land separately.
actions/labelerapplies 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 β¨andmaintenance πboth map totype: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 isz-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 carriedcrowdin.ymlandi18n/**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: thetriagecheck succeeded where every previous run had failed, and the labeler appliedarea:ci, correctly matched and canonical.The
triagecheck on this pull request is still expected to fail, becausepull_request_targetruns 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.