Get list of all buildkite environment variables

Hi
I want to collect all the environment variables from a particular build. How is this possible using -

  1. Buildkite API
  2. From inside the agent when the build is running

Hey!

Like it was discussed in your support email, you can check the API Jobs API | Buildkite Documentation, or with GraphQL you can query by job and have something like:

query {
agent(slug:"{org}/{agent-uuid}") {
  jobs (first:50) {
    edges {
      node {
        ... on JobTypeCommand {
          env
        }
      }
    }
  }
}

Best!

1 Like

Hey Rishabh!

We have a secret URL that can help with this. If you append /variables to the build URL, you get a fairly comprehensive breakdown. For example: https://buildkite.com/your-organization/pipeline-name/builds/1234/variables/

Hope that helps!

1 Like

Thanks folks! That helped.