Replace unmaintained labels CLI with a stdlib label sync script - #13
Merged
Merged
Conversation
Port of the fix applied to django-pagination-py3 (commit bcfa5b7).
The "Sync Github labels" workflow has been failing since GitHub made label
archiving GA (2026-08-27). Every label object in the REST API now carries
`archived_at` and `archived_by`, and the `labels` package (hackebrot/labels)
deserialises responses into a strict frozen attrs class:
TypeError: Label.__init__() got an unexpected keyword argument 'archived_at'
That package last shipped in May 2020 and the upstream issue for this exact
error is still open with no response, so pinning cannot help. GitHub also adds
fields over time, so the replacement reads only the fields it manages and
ignores everything else.
- add .github/sync_labels.py: stdlib only (tomllib + urllib), no pip install
needed; keeps .github/labels.toml as the source of truth and reproduces
`labels sync` semantics (create missing, update drifted, delete extras),
plus --dry-run, --no-delete, config validation and real exit codes
- run it from the workflow and scope permissions explicitly
(contents: read, issues: write) instead of relying on the repo default
- compare colours case-insensitively: the old CLI diffed "687DEA" against
GitHub's normalised "687dea" and re-PATCHed those labels on every run
- rename the github-actions label to Dependabot's own github_actions, so the
sync stops deleting the label Dependabot recreates on every bump
The remote dry-run against matagus/quickup reports: github_actions recoloured
000000 -> 595e8a, the unused hyphen variant deleted, 28 labels unchanged.
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.
The "Sync Github labels" workflow has been failing since GitHub made label archiving GA (2026-08-27). Every label object in the REST API now carries
archived_atandarchived_by, and thelabelspackage (hackebrot/labels) deserialises responses into a strict frozen attrs class:That package last shipped in May 2020 and the upstream issue for this exact error is still open with no response, so pinning cannot help. GitHub also adds fields over time, so the replacement reads only the fields it manages and ignores everything else.
labels syncsemantics (create missing, update drifted, delete extras), plus --dry-run, --no-delete, config validation and real exit codesThe remote dry-run against matagus/quickup reports: github_actions recoloured 000000 -> 595e8a, the unused hyphen variant deleted, 28 labels unchanged.