I’ve been looking extensively but haven’t found anything that’d satisfy my requirements. My app uses env variables defined in Netlify to use correct backend service instance. We also run two versions -
master branch) and
development branch). Variables for both of those version are defined in Netlify with
STAGING_ prefixes respectively. When doing production or branch deploys, picking the correct env variable isn’t an issue - I can use the
CONTEXT variable supplied by Netlify to know which variables to use.
The problem I’m facing is this - how can I use the correct variables in the same fashion but for deploy previews for Pull Requests? When a PR is targeting the
master branch, I’d like to use the
PRODUCTION_ variables, otherwise the
STAGING_ ones. Is there some way to know what branch the PR is targeting? Neither
BRANCH seem to be what I’m looking for.
Would greatly appreciate any help in that regard!