fix: pin auto-installed @commitlint/* configs to engine major#38
Merged
Conversation
A declarative config that extends a @commitlint/* preset without an explicit version was installed as latest. config-conventional@20 is ESM-only and its parser preset is not loaded by the bundled v19 engine, so the breaking-change "!" parses as an empty header and fails with "type/subject may not be empty". Pin the @commitlint scope to the engine major (^19); other packages still default to latest. Closes #37
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
A declarative commitlint config that
extendsa@commitlint/*preset without pinning a version (e.g.extends: ["@commitlint/config-conventional"]) was written into the generatedpackage.jsonas*, so npm installed the latest major. The action bundles the commitlint engine (@commitlint/lint/load) at^19, and@commitlint/config-conventional@20is ESM-only with aparserPresetthe v19 engine does not load. The conventional parser then falls back to the default parser, which does not understand the breaking-change!, so a perfectly validfeat!: …commit parses as an empty header and fails withtype may not be empty/subject may not be empty.This pins detected
@commitlint/*configs to the bundled engine's major (^19) when no explicit version is given; every other package still defaults to*.Related Issue
Closes #37
Motivation and Context
The action's code did not change —
@commitlint/config-conventionalpublished a v20 major and the action installed@latest, so the runtime drifted under stable code. Any repository using afeat!:/fix!:breaking-change commit started failing the lint with a misleading "empty type/subject" error. Pinning the install to the engine major restores correct parsing and keeps the resolved config ABI-compatible with the bundled engine.How Has This Been Tested?
@commitlint/config-conventionalis written as^19(not*).npm test(84 tests) passes;npm run build,npm run lint, andnpm run format:checkare clean.distagainst a livefeat!:PR and confirmed the rebuiltdistresolves config-conventional^19and parses the breaking-change header correctly.Documentation:
N/A — internal dependency-resolution fix; no user-facing API or input changes.
Checklist: