mutation-testing-elements icon indicating copy to clipboard operation
mutation-testing-elements copied to clipboard

Parent `npm run all` fails

Open Andreas02-dev opened this issue 7 months ago • 1 comments

nx affected fails since we have the 'master' branch instead of the 'main' branch. We should specify the base branch in the command to resolve this or rename the 'master' branch to 'main'.

Output for `npm run all` npm run all

[email protected] all nx affected --target=lint:prettier,lint,build,test

NX Affected criteria defaulted to --base=main --head=HEAD

fatal: ambiguous argument 'main': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]'

NX Command failed: git diff --name-only --no-renames --relative "main" "HEAD"

fatal: ambiguous argument 'main': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]'

Pass --verbose to see the stacktrace.

Andreas02-dev avatar May 23 '25 08:05 Andreas02-dev

I'm not sure if we can set this using a configuration option. But you can also use the environment variable: NX_BASE=master npm run all. We don't want to set this in CI as the nx setup action will set the correct base git ref.

hugo-vrijswijk avatar May 23 '25 12:05 hugo-vrijswijk