nx
nx copied to clipboard
NX_HEAD and NX_BASE not read from .env
Current Behavior
When setting NX_BASE=<some-ref> in a .env file at the root of the repo, NX commands still default to --base=main and --head=HEAD.
Expected Behavior
NX reads the .env file at the root, and knows about NX_BASE and NX_HEAD. When running commands such as nx affected or nx graph --affected, it takes these values into consideration.
GitHub Repo
https://github.com/mpsanchis/nx-examples
Steps to Reproduce
- Clone the github repo provided
- Yarn install (.tool-versions provided for those using rtx)
- Run
npx nx graph --affectedand see the messageAffected criteria defaulted to --base=master --head=HEAD
Nx Report
Node : 18.14.0
OS : darwin-arm64
yarn : 1.22.19
nx : 16.4.0-beta.3
@nx/js : 16.4.0-beta.3
@nx/jest : 16.4.0-beta.3
@nx/linter : 16.4.0-beta.3
@nx/workspace : 16.4.0-beta.3
@nx/angular : 16.4.0-beta.3
@nx/cypress : 16.4.0-beta.3
@nx/devkit : 16.4.0-beta.3
@nx/eslint-plugin : 16.4.0-beta.3
@nx/react : 16.4.0-beta.3
@nrwl/tao : 16.4.0-beta.3
@nx/web : 16.4.0-beta.3
@nx/webpack : 16.4.0-beta.3
nx-cloud : 16.0.5
typescript : 5.0.4
---------------------------------------
Community plugins:
@ngrx/component-store : 16.0.0
@ngrx/effects : 16.0.0
@ngrx/entity : 16.0.0
@ngrx/router-store : 16.0.0
@ngrx/store : 16.0.0
@ngrx/store-devtools : 16.0.0
Failure Logs
`Affected criteria defaulted to --base=master --head=HEAD`
Operating System
- [X] macOS
- [ ] Linux
- [ ] Windows
- [ ] Other (Please specify)
Additional Information
No response