forked from mirrors/probot
1.6 KiB
1.6 KiB
Contributing
Developing locally
To develop locally, you will need the latest version of Node.js. After cloning the repo:
- Run
$ script/bootstrap
to install all the project dependencies - 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:
- Download ngrok (
$ brew cask install ngrok
on a mac), which will expose a local server to the internet. - With the server still running, open a new terminal tab and run
ngrok http 3000
, which should output something likeForwarding http://4397efc6.ngrok.io -> localhost:3000
. - 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.
- 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. - Re-start the local server with the token by running:
$ GITHUB_TOKEN=xxx script/server
- 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).