1. Resources
  2. /
  3. Plugins
  4. /
  5. github-app-token-buildkite-plugin

GitHub App Token Buildkite Plugin

Generate a GitHub App installation access token and export it as an environment variable for Buildkite steps.

This is the Buildkite equivalent of actions/create-github-app-token.

How it works

  1. Reads the App ID, private key, and installation ID from Buildkite secrets
  2. Signs a JWT (RS256) using the private key
  3. Exchanges the JWT for an installation access token via the GitHub API
  4. Exports the token as GH_TOKEN (or a configured variable name)

The token is valid for one hour and has the permissions granted to the GitHub App installation.

Example

steps:
  - label: ":github: Create Release"
    plugins:
      - github-app-token#v1.0.0: ~
    command: gh release create v1.0.0 --generate-notes

This requires three Buildkite secrets: GITHUB_APP_ID, GITHUB_APP_PRIVATE_KEY, and GITHUB_APP_INSTALLATION_ID. The gh CLI automatically uses the exported GH_TOKEN.

Custom Secret Names

If your secrets use different env var names:

plugins:
  - github-app-token#v1.0.0:
      app-id-env: MY_GITHUB_APP_ID
      private-key-env: MY_GITHUB_APP_KEY
      installation-id-env: MY_GITHUB_APP_INSTALL_ID

GitHub Enterprise Server

plugins:
  - github-app-token#v1.0.0:
      api-url: https://github.example.com/api/v3

Configuration

OptionDefaultDescription
app-id-envGITHUB_APP_IDEnv var containing the GitHub App ID
private-key-envGITHUB_APP_PRIVATE_KEYEnv var containing the PEM private key
installation-id-envGITHUB_APP_INSTALLATION_IDEnv var containing the installation ID
token-variableGH_TOKENEnv var name to export the token as
api-urlhttps://api.github.comGitHub API base URL
hookenvironmentWhich hook to run in: environment or pre-command

Config values are env var names, not secrets themselves — secrets never appear in pipeline YAML.

Requirements

  • bash
  • curl
  • openssl
  • jq

All four are available on Buildkite hosted agents and most CI environments.

Secrets Setup

  1. Create a GitHub App with the permissions your pipeline needs
  2. Install the app on your organization or repository
  3. Note the App ID (from the app’s settings page) and Installation ID (from the URL after installing: https://github.com/settings/installations/<ID>)
  4. Generate a private key (PEM format) from the app’s settings page
  5. Add all three as Buildkite secrets:
bk secret set GITHUB_APP_ID "12345"
bk secret set GITHUB_APP_PRIVATE_KEY "$(cat private-key.pem)"
bk secret set GITHUB_APP_INSTALLATION_ID "67890"

Why GitHub Apps over Personal Access Tokens?

  • Not tied to a human — Apps are their own identity; no single point of failure
  • Fine-grained permissions — Request only what the pipeline needs
  • Higher rate limits — 5,000 requests/hour per installation vs 5,000/hour per user
  • Automatic expiry — Installation tokens expire after 1 hour; PATs can live forever
  • Audit trail — Actions are attributed to the app, not a person

Development

bats tests/plugin.bats
docker run --rm -v "$PWD:/plugin" -w /plugin buildkite/plugin-linter --id tommeier/github-app-token --path /plugin
shellcheck hooks/* lib/*.bash

The plugins listed on this webpage are provided for informational purposes only. They have not undergone any formal security review or assessment. While we strive to provide useful resources, we cannot guarantee the safety, reliability, or integrity of these plugins. Users are strongly advised to conduct their own security evaluations before downloading, installing, or using any plugin. By using these plugins, you acknowledge and accept any risks associated with their use. We disclaim any liability for any harm or damages arising from the use of the plugins listed.

Start turning complexity into an advantage

Create an account to get started for free.

Buildkite Pipelines

Platform

  1. Pipelines
  2. Public pipelines
  3. Test Engine
  4. Package Registries
  5. Mobile Delivery Cloud
  6. Pricing

Hosting options

  1. Self-hosted agents
  2. Mac hosted agents
  3. Linux hosted agents

Resources

  1. Docs
  2. Blog
  3. Changelog
  4. Example pipelines
  5. Plugins
  6. Webinars
  7. Case studies
  8. Events
  9. Migration Services
  10. CI/CD perspectives

Company

  1. About
  2. Careers
  3. Press
  4. Security
  5. Brand assets
  6. Contact

Solutions

  1. Replace Jenkins
  2. Workflows for MLOps
  3. Testing at scale
  4. Monorepo mojo
  5. Bazel orchestration

Legal

  1. Terms of Service
  2. Acceptable Use Policy
  3. Privacy Policy
  4. Subprocessors
  5. Service Level Agreement
  6. Supplier Code of Conduct
  7. Modern Slavery Statement

Support

  1. System status
  2. Forum
© Buildkite Pty Ltd 2026