How to check if script is running in actions environment

I want to use same connection string but different db name in github action

....
dbName: process.env.NODE_ENV == "what???" ? "test-db" : "live-db"
....

There’s an environment variable provided for that:

GITHUB_ACTIONS: Always set to true when GitHub Actions is running the workflow. You can use this variable to differentiate when tests are being run locally or by GitHub Actions.

Of course that requires that you don’t create an environment variable with that name in your local builds, but I also don’t see why you’d need to. :slightly_smiling_face: