Hey team,
I was looking through the documents and the topics here. I am looking into generating a github token in a step and passing it down to the next steps. I wonder what is the best way to do so? I tried buildkite-agent env
but the value is not available on the next step this way and is limited to the current step. I tried buildkite-agent metadata
, but the token is not being redacted. I see in the newer version of agent this is fixed, but I wonder if this is the best way to do it or if there is a better way.
Hey @ehsan.soure,
Welcome to the Buildkite community!
You can store the token as a secret environment variable in a Buildkite hook (eg environment hook).
Alternatively, you could store token in a secret management service ( like AWS Secret Manager, HashiCorp Vault or SSM). Buildkite provides various plugins that integrate reading and exposing secrets to your build steps using secrets storage services, such as the following. If a plugin for the service you use is not listed below or in Buildkite’s plugins directory, please contact support.
Hope this helps!