Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot reliably depend on NOW_GITHUB_* environment variables. #349

Closed
emmenko opened this issue Apr 8, 2020 · 0 comments · Fixed by #351
Closed

Cannot reliably depend on NOW_GITHUB_* environment variables. #349

emmenko opened this issue Apr 8, 2020 · 0 comments · Fixed by #351
Labels
🐛 Type: Bug Something isn't working

Comments

@emmenko
Copy link
Member

emmenko commented Apr 8, 2020

Ref #342

TL;DR: the Github ZEIT Now integration seems to alias the domain when a PR is merged to master. This makes sense on one side, because there are technically no changes, but as soon as we rely on NOW_GITHUB_* environment variables, we have a problem.

This is the case for things like rendering the cookie consent scripts.

const isProduction = process.env.GATSBY_NODE_ENV === 'production';
const isNowBuild = Boolean(process.env.GATSBY_NOW_GITHUB_DEPLOYMENT);
const isMasterBranch = process.env.GATSBY_NOW_GITHUB_COMMIT_REF === 'master';

See:

We need to find a different solution for conditionally render elements or not, as we can't rely on those environment variables anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant