--ignoreChanges is not respected.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 36.1k
- Forks
- 2.3k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 50
Description
Lerna Version: 8.1.9
Current Behavior
Hi all,
I'm running into an issue where in my CICD pipeline, I do a hotswap of .npmrc for an alternative cicd.npmrc with a mv cicd.npmrc .npmrc command prior to running lerna version/lerna publish
I've tried configuring Lerna according to the documentation and various issues I've seen around this, with my lerna.json configured as so:
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "independent",
"command": {
"publish": {
"ignoreChanges": [
".npmrc",
"cicd.npmrc"
]
}
},
"packages": [
"packages/*"
]
}
I've also tried configuring my lerna CLI as such
npx lerna publish --ignore-changes 'cicd.npmrc' '.npmrc' --canary --exact --dist-tag ${CI_COMMIT_REF_SLUG} --preid "${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}" --yes ${FORCED_PKGLIST} --concurrency 1
However end result is I get this output
Expected Behavior
As far as I can tell, the issue is that the code for checking the working directory here
completely ignores the configuration that's passed in. I would expect the ignoreChanges configuration to work as expected.
Related Issues
It seems like this may be related to this issue https://github.com/lerna/lerna/issues/2522 which was never resolved.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with libs/core/src/lib/collect-uncommitted.ts at the linked check, then trace how ignoreChanges from lerna.json and the --ignore-changes CLI option reaches it. Reproduce the CICD .npmrc swap with lerna version or publish and confirm that the configured .npmrc and cicd.npmrc changes are ignored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- release
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100