1. Resources
  2. /
  3. Plugins
  4. /
  5. github-pull-request-buildkite-plugin

Github Pull Request Buildkite Plugin

tests

A Buildkite plugin that lets you open Github pull requests.

Once opened the number identifying the new Github pull request will be stored in the build meta-data with key: github-pull-request-plugin-number.

Example

The only required configuration is the pull request title. In this case the pull request body will be empty, and the new pull request will propose merging the current branch into master.

steps:
  - label: ":github: Open Pull Request"
    plugins:
      - envato/github-pull-request#v0.4.0:
          title: "Example pull request title"

One can specify the branches to use. Here we open a pull request to merge the feature-1 branch into staging.

steps:
  - label: ":github: Open Pull Request"
    plugins:
      - envato/github-pull-request#v0.4.0:
          title: "Deploy feature-1 to staging"
          head: "feature-1"
          base: "staging"

One can specify a cross account pull request also:

steps:
  - label: ":github: Open Pull Request"
    plugins:
      - envato/github-pull-request#v0.4.0:
          title: "Please accept my cool feature"
          head: "my-account:my-branch"
          repo: "someone-elses-account/project"

To request reviews:

steps:
  - label: ":github: Open Pull Request"
    plugins:
      - envato/github-pull-request#v0.4.0:
          title: "Example pull request title"
          reviewers:
            - toolmantim
            - keithpitt
          team-reviewers:
            - a_team
            - b_team

To add labels:

steps:
  - label: ":github: Open Pull Request"
    plugins:
      - envato/github-pull-request#v0.4.0:
          title: "Example pull request title"
          labels:
            - wip
            - security

Authentication

This plugin needs to authenticate with Github to open pull requests. To do so it needs an API token. To provide this please store the token in the GITHUB_TOKEN environment variable.

While this works, it’s not recommended to commit unencrypted private tokens to SCM.

steps:
  - label: ":github: Open Pull Request (not recommended)"
    plugins:
      - envato/github-pull-request#v0.4.0:
          title: "Example pull request title"
    env:
      - GITHUB_TOKEN=<my-secret-token>

Instead, provide your secrets in via a secure mechanisim. Perhaps using the AWS S3 Secrets Buildkite Plugin.

Configuration

title

The title of the pull request.

body (optional)

The contents of the pull request. Add some context and description of the changes being proposed.

head (optional)

The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace head with a user like this: username:branch.

Default: BUILDKITE_BRANCH (The current branch being built)

base (optional)

The name of the branch you want the changes pulled into. This should be an existing branch on the repository (see below).

Default: master

repo (optional)

The repository on which the proposed changes will be pulled into. In the form owner/project.

Default: The repository of the pipeline currently being built.

reviewers (optional)

A list of users who will be requested to review the pull request. The reviewers must be collaborators on the project.

team-reviewers (optional)

A list of teams who will be requested to review the pull request. The teams must be collaborators on the project.

labels (optional)

A list of labels that will be added to the pull request.

Development

To run the tests:

docker-compose run --rm tests

To run the Buildkite Plugin Linter:

docker-compose run --rm lint

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 with a 30-day free trial. No credit card required.

Buildkite Pipelines

Platform

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

Hosting options

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

Resources

  1. Docs
  2. Blog
  3. Changelog
  4. Webinars
  5. Plugins
  6. Case studies
  7. Events
  8. Migration Services
  9. Comparisons

Company

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

Solutions

  1. Replace Jenkins
  2. Workflows for AI/ML
  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

Support

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