This code is a generalization to power bots like @RichardBot, allowing it to edit a repository.
- Create a GitHub account for your bot.
- Create a public/private key pair for your bot.
- Clone the repo onto the computer where you want the bot to run.
- Put the private key into the root of the repo (but don't commit it).
- Install the GitHub CLI
hub. - Run
install.bash.
Assuming you already have the repository, and have installed everything, do the following:
cdinto the cloned repository.- Run
git-bot.bashfor a single run, orpython2.7 git_bot_watchdog.pyto have your bot run every time the file is changed. - beep happily.
For example, @RichardBot maintains a fork of the ghseeli/grad-school-notes repository where it put's changes. Then, it will create a pull request into ghseeli/grad-school-notes by running richard-bot.sh.