Skip to content

A Pull Request Hook that comments on pull requests from users who are contributing to the repository for the first time

License

Notifications You must be signed in to change notification settings

Deborah-Digges/pr-bot

Repository files navigation

pr-bot Code Health

A Pull Request Hook that comments on pull requests from users who are contributing to the repository for the first time

Instructions to set up pr-bot

  1. Clone this repository: git clone https://github.com/Deborah-Digges/pr-bot.git
  2. Fill in your github credentials(username & password) in app.properties
  3. Create a heroku account and download the heroku toolbelt
  4. Navigate to the folder where you cloned this repo: cd pr-bot
  5. Create a heroku app: heroku create
  6. Deploy the code: git push heroku master
  7. Ensure that atleast one instance of the app is running: heroku ps:scale web=1
  8. List your app with: heroku apps
  9. The service is now running at <heroku-app-name>.herokuapp.com
  10. Go to the settings page of the repository of interest.
  11. Navigate to WebHooks and Services
  12. Click on Add WebHook
  13. For Payload URL enter http://<heroku-app-name>.herokuapp.com/v1/PREvent
  14. Choose Let me select Individual Events and choose the Pull Request Event
  15. Add Webhook
  16. Get Someone to Open a PR on your repository :-)

To self-host using Docker

  1. Install Docker and Compose. OSX users can skip above two and install Docker Toolbox
  2. Move to this directory, and run docker-compose up web. It will install all the requirements on the first run
  3. Follow steps 8 through 14 in the previous list. In the Payload URL section of the Add webhook page of your Github repo settings, add <your-public-ip:5000|Public-URL>/v1/PREvent
  4. For development purposes, you can use Ngrok to set up a temporary local tunnel and make your local server accessible via a public URL.

To Deploy on Google App Engine

  1. Install Google App Engine SDK for Python.
  2. Go to Google Cloud Console and Create a project. Here is a quickstart.
  3. Copy the application id of the created project and paste it in application parameter of app.yaml file.
  4. Follow steps 8 through 14 in the instruction list. In the Payload URL section of the Add webhook page of your Github repo settings, add <your-application-id>.appspot.com/v1/PREvent
  5. Open the folder in Google App Engine Launcher as an existing project by Going to File -> Add Existing Application and deploy.
  6. Alternatively, deploy through command line by running appcfg.py -A <YOUR_APPLICATION_ID> update path-to-root-appengine-dir/.

Configuration

  1. Customize the message in app.properties
  2. Customize new-users in app.properties. When set to true, a comment is only made on a PR made by a new contributor.

Try It Out!

Submit a PR to this repository

Made with ❤️ - @Deborah-Digges

About

A Pull Request Hook that comments on pull requests from users who are contributing to the repository for the first time

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages