Giter VIP home page Giter VIP logo

github-webhook-resource's Introduction

Github Webhook Resource

Build Status Docker Pulls

By default, Concourse will check your resources once per minute to see if they have updated. In order to reduce excessive checks, you must configure webhooks to trigger Concourse externally. This resource automatically configures your GitHub respoitories to send webhooks to your Concourse pipeline the instant a change happens.

Resource Type Configuration

resource_types:
- name: github-webhook-resource
  type: docker-image
  source:
    repository: homedepottech/github-webhook-resource
    tag: latest

Source Configuration

resources:
- name: github-webhook
  type: github-webhook-resource
  source:
    github_api: https://github.example.com/api
    github_token: ((github-token))

Behavior

out: Manipulate a Github webhook

Create or delete a webhook using the configured parameters.

Parameters

- put: create-webhook
  resource: github-webhook
  params:
    org: github-org-name
    repo: github-repo-name
    resource_name: your-resource-name
    webhook_token: your-token
    operation: create
    events: [push, pull_request]
  • org: Required. Your github organization.
  • repo: Required. Your github repository.
  • resource_name: Required. Name of the resource to be associated with your webhook.
  • webhook_token: Required. Arbitrary string to identify your webhook. Must match the webhook_token property of the resource your webhook points to.
  • operation: Required.
    • create to create a new webhook. Updates existing webhook if your configuration differs from remote.
    • delete to delete an existing webhook. Outputs current timestamp on non-existing webhooks.
  • events: Optional. An array of events which will trigger your webhook. Default: push

Development

Prerequisites

Making changes

The Concourse entrypoints are in bin/check, bin/in, and bin/out. You can add functionality to these files directly, or you can require additional supporing files.

See the Reference section for some helpful information related to this project's implementation.

Running the tests

npm install
npm test

Before submitting your changes for review, ensure all tests are passing.

Building your changes

docker build -t github-webhook-resource .

To use the newly built image, push it to a Docker repository which your Concourse pipeline can access and configure your pipeline to use it:

docker tag github-webhook-resource example.com/github-webhook-resource
docker push example.com/github-webhook-resource
resource_types:
- name: github-webhook-resource
  type: docker-image
  source:
    repository: example.com/github-webhook-resource
    tag: latest

resources:
- name: github-webhook
  type: github-webhook-resource
  ...

Contributing

Please read the CONTRIBUTING.md file to learn the process for submitting changes to this repo.

License

This project is licensed under Apache 2.0 - see the LICENSE file for details.

Reference

github-webhook-resource's People

Contributors

billimek avatar dependabot[bot] avatar gavinfigueroa avatar joshq00 avatar

Watchers

 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.