Giter Site home page Giter Site logo

dhamu9690 / pullrequest-events-resource Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shinmyung0/pullrequest-events-resource

0.0 0.0 1.0 121 KB

Concourse resource to detect CLOSED and MERGED pull requests on Github

Shell 2.93% JavaScript 96.46% Dockerfile 0.61%

pullrequest-events-resource's Introduction

pullrequest-events-resource Build Status

This is a Concourse resource that fetches pull requests that have been MERGED or CLOSED recently. This is meant to address the use case of pipelines triggering on merge or close which are not supported within the excellent github-pullrequest-resource. This resource does not do any sort of git clone from git. It is rather meant to provide information about merged or closed pull request branches to trigger downstream jobs.

This resource currently only supports Github

Docker Hub Link

Source Configuration

resource_types:
- name: pull-request-events
  type: docker-image
  source:
    repository: shinmyung0/pullrequest-events-resource
    tag: latest


resources:
- name: github-pr-events
  type: pull-request-events
  source:
    access_token: ((github-access-token))
    owner: ((repo-owner))
    repo: ((app-name))
    graphql_api: ((github-v4-api))
    base_branch: master
    first: 5
    states:
      - MERGED
      - CLOSED
  • owner : Repo owner. required
  • repo : Repository. required
  • access_token: Github API access token, should have read-permissions on repo. required
  • graphql_api : Github GraphQL API endpoint. By default it is https://api.github.com/graphql
  • first : The number of pull request events to fetch from latest. default is 3.
  • states : List of pull request states to listen for. Only supports MERGED and CLOSED. Default is both.

Behavior

  • check: check for recently merged or closed pull requests

This will output versions that look like this:

[
  {
    "id": "MDExOlB1bGxSZXF1ZXN0MTcxMjQ5NjI1",
    "cursor": "Y3Vyc29yOnYyOpK5MjAxOC0wMi0yNVQxMjozNDo0NC0wODowMM4KNQ/Z",
    "number": "1",
    "url": "https://github.com/shinmyung0/fixture-repo/pull/1",
    "baseBranch": "master",
    "headBranch": "test-merged-branch",
    "state": "MERGED",
    "timestamp": "2018-02-25T20:34:44Z"
  },
  {
    "id": "MDExOlB1bGxSZXF1ZXN0MTcxMjQ5NzQw",
    "cursor": "Y3Vyc29yOnYyOpK5MjAxOC0wMi0yNVQxMjozNjoxNi0wODowMM4KNRBM",
    "number": "2",
    "url": "https://github.com/shinmyung0/fixture-repo/pull/2",
    "baseBranch": "master",
    "headBranch": "test-closed-branch",
    "state": "CLOSED",
    "timestamp": "2018-02-25T20:36:16Z"
  }
]
  • in: Given a version, will output that JSON object to $output_dir/pull_request JSON file.

$output_dir/pull_request file example:

{
  "id": "MDExOlB1bGxSZXF1ZXN0MTcxMjQ5NzQw",
  "cursor": "Y3Vyc29yOnYyOpK5MjAxOC0wMi0yNVQxMjozNjoxNi0wODowMM4KNRBM",
  "number": "2",
  "url": "https://github.com/shinmyung0/fixture-repo/pull/2",
  "baseBranch": "master",
  "headBranch": "test-closed-branch",
  "state": "CLOSED",
  "timestamp": "2018-02-25T20:36:16Z"
}
  • out: Not implemented.

pullrequest-events-resource's People

Contributors

dhamu9690 avatar tejaswi1009 avatar

Forkers

tejaswi1009

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.