nx
nx copied to clipboard
fix(core): load env vars from root .env when running affected commands #17634
Current Behavior
We do not load ENV vars from dotenv files when running affected commands. This means that people cannot build or create .env files at the root of their repo and have those values picked up when running affected commands.
Expected Behavior
We should load dotenv files at the root of the repo when running these commands
Related Issue(s)
Fixes #17634
@FrozenPandaz There could be an argument made that this loading of the dotenv files could/should happen earlier in the workflow, when nx is init for example. I've limited this to just the affected commands as that is what was raised in the issue linked, but I'm open to suggestions of a best place to do this, if this is something we want to do.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| nx-dev | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 27, 2023 11:36am |
☁️ Nx Cloud Report
CI is running/has finished running commands for commit 8dbd0a2a1c18ceb83addb409bf4f1db387f6a2f1. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.
📂 See all runs for this branch
✅ Successfully ran 8 targets
linux nx affected --target=e2e --base=f113bea262e5600d49953d124be00af9a0741cc9 --head=8dbd0a2a1c18ceb83addb409bf4f1db387f6a2f1 --parallel=1linux nx affected --target=test --base=f113bea262e5600d49953d124be00af9a0741cc9 --head=8dbd0a2a1c18ceb83addb409bf4f1db387f6a2f1 --parallel=1linux nx affected --target=build --base=f113bea262e5600d49953d124be00af9a0741cc9 --head=8dbd0a2a1c18ceb83addb409bf4f1db387f6a2f1 --parallel=3linux nx run-many -t check-imports check-commit check-lock-files check-codeowners documentation --parallel=1 --no-dtelinux nx affected --target=lint --base=f113bea262e5600d49953d124be00af9a0741cc9 --head=8dbd0a2a1c18ceb83addb409bf4f1db387f6a2f1 --parallel=3nx-cloud record -- nx format:check --base=f113bea262e5600d49953d124be00af9a0741cc9 --head=8dbd0a2a1c18ceb83addb409bf4f1db387f6a2f1linux nx documentation --no-dtemacos nx affected -t e2e-macos --parallel=1 --base=f113bea262e5600d49953d124be00af9a0741cc9 --head=8dbd0a2a1c18ceb83addb409bf4f1db387f6a2f1
Sent with 💌 from NxCloud.
Hi Colum! Thanks for picking this up. Any chance this gets merged in the next (beta) version? We'd love to have this 🤩
Waiting on this. Can we merge?
Closing in favour of: #18456
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.