Shared environment variables

Hello!

I am having an issue with shared environment variables, I have set up a new variable to be used across all our sites, a var used in .npmrc to access our private repos. However, every build fails saying Failed to replace env in config: ${VAR}

The builds work when each site has the variable set on a site level, but I want to move it to shared across the team for ease and convenience moving forward. So it seems its not being pulled into the build, its set to be used for all scopes.

Please can you point me in the right direction on how to get this to work!

Thanks

Could you please share your account slug or a site name?

Our team name is Flocc, and we want this shared environment variable to apply to all of our site. We think its overriding an environment variable if its exists at site level. But if not if it doesn’t exist.

Hey @floccdan,

Thanks for the account name. We tried checking, but it appears that the site-level vars are same as account-level var that you currently have set. Could you confirm the following:

  1. If you’re still seeing this problem?
  2. If yes, which site is this happening on?
  3. I currently see only 1 account-level variable, but to confirm, is this happening with any account-level variable?

Hey!
Thank you for getting back to me, here are the responses to your questions.

  1. Yes I have made the site level Vars the same, so they build. Ideally I want to remove them and only use the account level one. But we have daily builds so we need to have it in the site level to work right now.

  2. All sites I have tried to build using the account level var fails.

  3. I have only tried one account var, as thats all I need. I have change the value of the var a few times to see if it was a problem with the value but still the same issue.

Thank you for the details, @floccdan. I’ve filed this for our devs to look at. Meanwhile,

could you please share an example deploy link where this happened?

Hi floccdan, we tried reproducing this issue and our deploy worked as expected. Can you remove the site level GITHUB_TOKEN env variable and re-deploy? We would like to examine that deploy so as to understand why this is not working for you.

Hi,
I have just tried this on two if our sites and it works. Has something changed your end?
I tried this originally and it did not work.

Thanks

Hey @floccdan,

We’ve confirmed with the devs, and they mention nothing has changed in this area. So we don’t know what caused it, but glad to know it’s fixed. If it happens again, feel free to let us know.