Passing a secret during build #4256
Replies: 1 comment 8 replies
-
By default, the Homebrew build environment filters out all environment variables except for a select list that are allowed; any environment variable with a Thus, in your CD, one thing you can try is to expose the API key as an environment variable that starts with Note that Homebrew also has some secondary filtering in place that may remove sensitive environment variables from the build environment. From your use case it doesn't sound like this filtering will block you, but just something to keep in mind if you run into issues. More about Homebrew's environment variable filtering behaviors: https://docs.brew.sh/Formula-Cookbook#using-environment-variables |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Output of
brew config
Output of
brew doctor
Description of issue
I have a weird issue that I'm sure it must have been solved, however, I see no way of solving it. I have a tool written in Go, that requires an API key to connect to a service. We build this tool as part of our CD on Github and pass in the API key as a Github secret. That all works well. The problem is, using a homebrew formula to build the binary we can't pass in those values in a secure format, and I don't think they can access those secret values on GitHub. Is there any way to accomplish this? This values are not critical but would be better to stay as obfuscated as possible (I'm aware you could potentially reverse engineer the binary to find them, but our attempt is just to prevent them being in plain text).
Beta Was this translation helpful? Give feedback.
All reactions