nx icon indicating copy to clipboard operation
nx copied to clipboard

NX_HEAD and NX_BASE not read from .env

Open mpsanchis opened this issue 2 years ago • 0 comments

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

  1. Clone the github repo provided
  2. Yarn install (.tool-versions provided for those using rtx)
  3. Run npx nx graph --affected and see the message Affected 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

mpsanchis avatar Jun 16 '23 14:06 mpsanchis