A Pull Request Hook that comments on pull requests from users who are contributing to the repository for the first time
- Clone this repository:
git clone https://github.com/Deborah-Digges/pr-bot.git
- Fill in your github credentials(username & password) in
app.properties
- Create a heroku account and download the heroku toolbelt
- Navigate to the folder where you cloned this repo:
cd pr-bot
- Create a heroku app:
heroku create
- Deploy the code:
git push heroku master
- Ensure that atleast one instance of the app is running:
heroku ps:scale web=1
- List your app with:
heroku apps
- The service is now running at
<heroku-app-name>.herokuapp.com
- Go to the settings page of the repository of interest.
- Navigate to
WebHooks and Services
- Click on
Add WebHook
- For
Payload URL
enterhttp://<heroku-app-name>.herokuapp.com/v1/PREvent
- Choose
Let me select Individual Events
and choose thePull Request Event
- Add Webhook
- Get Someone to Open a PR on your repository :-)
- Install Docker and Compose. OSX users can skip above two and install Docker Toolbox
- Move to this directory, and run
docker-compose up web
. It will install all the requirements on the first run - Follow steps 8 through 14 in the previous list. In the
Payload URL
section of theAdd webhook
page of your Github repo settings, add<your-public-ip:5000|Public-URL>/v1/PREvent
- For development purposes, you can use Ngrok to set up a temporary local tunnel and make your local server accessible via a public URL.
- Install Google App Engine SDK for Python.
- Go to Google Cloud Console and Create a project. Here is a quickstart.
- Copy the application id of the created project and paste it in
application
parameter ofapp.yaml
file. - Follow steps 8 through 14 in the instruction list. In the
Payload URL
section of theAdd webhook
page of your Github repo settings, add<your-application-id>.appspot.com/v1/PREvent
- Open the folder in Google App Engine Launcher as an existing project by Going to File -> Add Existing Application and deploy.
- Alternatively, deploy through command line by running
appcfg.py -A <YOUR_APPLICATION_ID> update path-to-root-appengine-dir/
.
- Customize the
message
inapp.properties
- Customize
new-users
inapp.properties
. When set to true, a comment is only made on a PR made by a new contributor.
Submit a PR to this repository