How to post ENV Variables to Github Actions

Hi there,

during the Build Process we need to imbed some ENV Variables in the Code.
If we build it with cleavr on our own Server this works. (Not by taking it from the .env File but in the Build Settings)

But if we activate Github Actions we need to give it to Github via

  • Actions.yaml File (Which is for Security reasons a bad idea)
    or
  • Via the Build Command:
    grafik
    Build Command just gives us a line where we can put it. We have multiple Variables we have to pass, so this will be not really visible.

We have in those cases to support ENV Variables in 3 different Formats and 3 different places.

If you have another way of handling this or maybe we can find a better solution, this would be awesome.

Good question!

If environment variables are required during build and you are using GitHub Actions, then it is true that we don’t have a way to send .env to GitHub. In this case, I’d recommend updating the workflow file and passing in the variables using GitHub Secrets so that there is security around them. Check out their docs for some direction on how to accomplish that - Encrypted secrets - GitHub Docs

1 Like