Skip to content

Latest commit

 

History

History
89 lines (67 loc) · 2.08 KB

README.md

File metadata and controls

89 lines (67 loc) · 2.08 KB

🤖 CanadaBot

The Pull Request Bot for Anonymous contributions on GitHub!


With PRB0t you can make pull request on GitHub by using a JSON description of the changes.

Url: POST:https://canada-pr-bot.herokuapp.com/

Request Sample:

{
  "user": "<github-user>",
  "repo": "<github-repo>",
  "title": "<pull-request-title>",
  "description": "<pull-request-description>",
  "commit": "<commit-description>",
  "files": [
  	{"path": "<file-path>", "content": "<file-content>"}
  ]
}

What can you do with it?

  • If you have a static website hosted in github... you could add a button Edit this page.
  • You can contribute anonymously to the Internet 🕸.
  • You can upload files.

Try it!

curl -X POST \
  https://canada-pr-bot.herokuapp.com/ \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{
  "user": "j-rewerts",
  "repo": "trash",
  "description": "🤖",
  "title": "Review this",
  "commit": "a commit",
  "files": [
  	{"path": "README.md", "content": "Bleep bloop."}
  ]
}'

Or try it in your browser!

Or try it in Postman!

Docker

You can also run PRB0t with Docker! Just run

docker run -p3000:3000 -e GH_TOKEN={YOUR GITHUB TOKEN} jrewerts/prb0t:latest

Development

This project uses Node.js and the Micro framework. To get started

  1. Clone this repository.
git clone https://github.com/canada-ca/canada-bot
  1. From within the newly cloned repo, install dependencies.
npm install
  1. Set the environment variable GH_TOKEN to your accounts personal access token. For more info on PATs, see here.
On Mac/Linux
export GH_TOKEN=YOUR_TOKEN
  1. Run CanadaBot.
npm run dev

Deployment

Updating CanadaBot is done automatically. Currently, it's hosted in Heroku. When master is changed, a new deploy is created.