Giter VIP home page Giter VIP logo

github-autoresponder's Introduction

GitHub Autoresponder

An ASP.NET Core webhook for automatically responding to GitHub issues and PRs.

Demo screen capture

Try Me!

Open an issue against this repository to receive an automated response.

Setup

  • Install .NET Core
  • git clone https://github.com/jamesseanwright/github-autoresponder.git
  • cd github-autoresponder
  • dotnet restore

Then one can run:

  • dotnet xunit - execute the unit tests
  • dotnet start - start the server

The sole exposed endpoint can be found at /api/webhook, which:

Environment Variables

This service requires two environment variables to function:

GHAR_SECRET

The secret token specified when registering the webhook in your repository's settings.

GHAR_CREDENTIALS

A Base64-encoded string following a <responding_username>:<personal_api_token> format e.g. "jamesseanwright:somerandomsha1"

  • responding_username - the username used to respond to issues and PRs
  • personal_api_token - the personal API token to be used, along with the username, to authenticate requests made to the GitHub API
    • Note that the only required scope is public_repo

Registering the Webhook Against a Repository

Registering a webhook

  1. Go to one of your repositories
  2. Click Settings
  3. Click Webhooks
  4. In Payload URL, enter the absolute URL via which the webhook can be accessed, including the /api/webhook path
  5. Select application/json from the Content type dropdown
  6. Enter the webhook secret that you most likely generated in the previous section (see GHAR_SECRET)
  7. Under Which events would you like to trigger this webhook?, choose Let me select individual events, and select: Issues; and Pull request
  8. Click Add webhook to complete the registration

Changing the Response Message

Currently, the response message is a hard-coded string that lives in the ResponseFactory class. Eventually, this will be separated into a Markdown file to be read at startup.

github-autoresponder's People

Contributors

jamesseanwright avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

github-autoresponder's Issues

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.