Code Monkey home page Code Monkey logo

github-pull-request-buildkite-plugin's Introduction

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

github-pull-request-buildkite-plugin's People

Contributors

bing-violet avatar orien avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.