Skip to content

--ignoreChanges is not respected. #4144

@danceroutine

Description

@danceroutine

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

Image

Expected Behavior

As far as I can tell, the issue is that the code for checking the working directory here

export function collectUncommitted({ cwd, log = npmlog }: UncommittedConfig): Promise<string[]> {

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 #2522 which was never resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions