danger / danger-js

⚠️ Stop saying "you forgot to …" in code review
http://danger.systems/js/
MIT License
5.26k stars 368 forks source link

[BUG] process.env - Cannot read properties of undefined (reading 'env') #1399

Open RareSecond opened 1 year ago

RareSecond commented 1 year ago

Describe the bug Using process.env.whatever in a danger file leads to a runtime error stating that process is undefined.

To Reproduce

  1. Create a dangerfile
  2. Add a reference to process.env
  3. See the error

Expected behavior You should be able to access process.env

Screenshots CleanShot 2023-08-17 at 08 08 11

Your Environment

software version
danger.js 11.2.0
node node:16 docker image
npm 7.11.0 (pnpm)
Operating System Gitlab CI

Additional context Add any other context about the problem here.

orta commented 1 year ago

Huh, interesting, I wonder how 6 years down the line you're the first to hit this.

Maybe part of initial security models block certain globals, I thought that was all removed though when running locally - you're welcome to take a look 👍🏻