probot/CONTRIBUTING.md

1.6 KiB

Contributing

Developing locally

To develop locally, you will need the latest version of Node.js. After cloning the repo:

  1. Run $ script/bootstrap to install all the project dependencies
  2. Run $ script/server to run the server on http://localhost:3000

To test with a real GitHub repository, you'll need to create a test repository and configure a new webhook:

  1. Download ngrok ($ brew cask install ngrok on a mac), which will expose a local server to the internet.
  2. With the server still running, open a new terminal tab and run ngrok http 3000, which should output something like Forwarding http://4397efc6.ngrok.io -> localhost:3000.
  3. Head over to the Settings page of your repository, and click on Webhooks & services. Then, click on Add webhook. Configure it with:
  • Payload URL: Use the full *.ngrok.io
  • Secret: development
  • Which events would you like to trigger this webhook?: Choose Send me everything.
  1. Until this gets built into a proper Integration, the bot will need a valid GitHub API token to be able to do anything useful. Create a new Personal access token and select the repo scope.
  2. Re-start the local server with the token by running: $ GITHUB_TOKEN=xxx script/server
  3. To test it out, make sure your test repository has a .github/ISSUE_REPLY_TEMPLATE.md with content in it, then open a new issue. Your bot should autorespond (you may need to refresh to see it).