Public | Automated Build

Last pushed: 2 years ago
Short Description
Full Description

Github Pull Request Resource

Tracks pull requests made to a particular github repo. In the spirit of Travis
, a status of pending, success, or failure will be
set on the pull request, which much be explicitly defined in your pipeline.

Please checkout our CI Pipeline.

Deploying to Concourse

In your bosh deployment manifest, add to the groundcrew.additional_resource_types with the following:

- image: docker:///jtarchie/pr
  type: pull-request

Source Configuration

  • repo: Required. The repo name on github.
    Example: jtarchie/pullrequest-resource

  • access_token: Required. An access token with repo:status access.

  • base_url: Optional The base URL for the Concourse deployment, used for
    linking to builds. If not present, no link is provided on the Github pull

  • private_key: Optional. Private key to use when pulling/pushing.

      private_key: |
        -----BEGIN RSA PRIVATE KEY-----
        <Lots more text>
        -----END RSA PRIVATE KEY-----
  • api_endpoint: Optional. If the repository is located on a GitHub Enterprise
    instance you need to specify the base api endpoint (e.g. "https://\<hostname>/api/v3/").


check: Check for new pull requests

New pull requests that have no concourseci status messages are pulled in.
Since the nature of Concourse is to always have the latest version, some jiggery
pokery was done to allow iteration of each pull request.

in: Clone the repository, at the given pull request ref

Clones the repository to the destination, and locks it down to a given ref.

Submodules are initialized and updated recursively.

out: Update the status of a pull request

Set the status message for concourseci context on specified pull request.


  • path: Required. The path of the repository to reference the pull request.

  • status: Required. The status of success, failure, error, or pending.

Example pipeline

This is what I am currently using to test this resource on Concourse.

- name: repo
  type: pull-request
    access_token: acecss_token
    private_key: |
      -----BEGIN RSA PRIVATE KEY-----
      My private key.
      -----END RSA PRIVATE KEY-----
    repo: jtarchie/pullrequest-resource
- name: test pull request
  - get: repo
    trigger: true
  - put: repo
      path: repo
      status: pending
  - task: do something with git
      platform: linux
      image: docker:///concourse/git-resource
        path: sh
        - -c
        - cd repo && git --no-pager show
      - name: repo
        path: ""
  - put: repo
      path: repo
      status: success


Tests can be run two ways, for local feedback and to see how it will run on the resource container.

  1. Local, requires ruby
gem install bundler
bundle install
bundle exec rspec
  1. Container, requires requires ruby and docker
gem install bundler
bundle install
rake test
Docker Pull Command
Source Repository