feat: upgrade to commitlint v21 on node 24 - #1
Merged
Conversation
Upstream is unmaintained: the last commit to master was 2025-01-14, and PR wagoid#837 (bump @commitlint to v20) has sat open since 2026-07-20. @commitlint/ensure v20 added an exemption for long lines containing a URL. Pinned to ^19, this action fails Dependabot commits on body-max-line-length, because their bodies are markdown link lists well over 100 chars, while a local pre-commit hook running v21 passes them. Take all @commitlint packages to ^21. That needs node >= 22.12, so move the image and the workflows to node 24.19.0 LTS. Bump commitlint-plugin-function-rules to ^5, the first release whose peer range admits v21; ^4 caps at "<20" and breaks npm ci. Publish to ghcr.io from a pushed tag rather than to Docker Hub via commit-and-tag-version, which needed credentials this fork does not have. CI now also builds the image on every push, which is what caught the peer conflict.
The commitlint-pulling-from-docker-hub job ran the action without rewriting action.yml, so it pulled whichever tag action.yml named. That tag only exists once the image is published, which happens after merge, so the job failed on every pull request that changed the version. Drop it and verify the image in publish-image.yml, after the push, where it exists. The check pulls from a cleared local cache so it exercises the registry rather than the layer just built.
actionlint refused checkout@v3 and cache@v3 outright as too old to run, and the runners were already forcing their node 20 entrypoints onto node 24. zizmor reported 20 findings, 7 of them high. Pin every action to a SHA with a version comment, set persist-credentials false so a checkout token cannot be picked up from the workspace, default the workflows to no permissions and grant each job only what it uses, and pass the commitlint results through the environment rather than interpolating them into a run block. actionlint and zizmor are both clean afterwards.
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.
Fork of
wagoid/commitlint-github-action, brought up to commitlint v21.Why fork
Upstream is unmaintained — last commit to
masterwas 2025-01-14, and the maintainer has no public activity. PR #837 bumps@commitlintto v20 and has been open andMERGEABLEsince 2026-07-20 with no response.The bug that matters to us:
@commitlint/ensurev20 added an exemption for long lines containing a URL.Pinned to
^19, this action fails Dependabot commits onbody-max-line-length— their bodies are markdown link lists (one real example is 314 chars on a line) — while a local pre-commit hook resolving v21 passes the same commit.What changed
@commitlint/*packages to^21..nvmrc,engines, and workflows. commitlint v21 requiresnode >= 22.12, which is why upstream PR fix(deps): bump @commitlint packages to v20 wagoid/commitlint-github-action#837 stopped at v20.commitlint-plugin-function-rules^4→^5.0.1. v4's peer range is@commitlint/lint ">=19 <20", which breaksnpm cioutright;^5.0.1allows">=19 <22".commit-and-tag-version+DOCKER_USERNAME/DOCKER_TOKEN) to ghcr.io, triggered by pushing av*tag.image-buildsjob. That job is what surfaced the peer conflict —npm installhad silently resolved around it, onlynpm ciin the container failed.FromAsCasingDockerfile warning.Verification
npm run lintclean, 39/39 tests pass,npm run buildsucceeds.docker buildsucceeds; image reportsv24.19.0and@commitlint/lint 21.2.0.src/action.mjs:146) against a realcommitlint.config.mjsand the Dependabot commit that broke CI:subject-case: [0].mjsoverride is honored, so #836 does not bite usAfter merge
v6.3.0→publish-image.ymlbuildsghcr.io/yo61/commitlint-github-action:6.3.0.