Bash script that auto-creates Pull Requests for a given repo.
- Clones the to-be-updated repo (
AP_REPO
) into a tmp dir - Does stuff (
AP_CMD
) - Creates a PR for the changes
- Profit!
This script uses environment variables for configuration; most must be set. Examples are from the ZoneDB project, which updates its data daily.
AP_REPO
— GitHub repository to auto-update, in the form ofuser/repo
, e.g.zonedb/zonedb
AP_BRANCH
— Branch to check out. Default:master
AP_SETUP_CMD
— Optional command to run before running the update command, e.g. for installing dependencies.AP_CMD
— Update command that mutates the repository. Default:make update
GH_USER
— GitHub username (yours or a bot)GH_TOKEN
– GitHub access token (not your password!)GIT_AUTHOR_NAME
andGIT_COMMITTER_NAME
— Name of the user or robot doing the committing. Both must be set.GIT_AUTHOR_EMAIL
andGIT_COMMITTER_EMAIL
— Email address of the user or robot doing the committing. Both must be set.
- Clone (or fork) this repository
- Create a Heroku app, which will run the
autopull
script - Set the above environment variables
- Add the Heroku Scheduler add-on:
heroku addons:create scheduler:standard
- Configure the work schedule:
heroku addons:open scheduler
and command to run (./autopull
) - Push your fork to Heroku:
git push {your Heroku app's git remote}
- Test:
heroku run ./autopull -a {your Heroku app name}
AP_CMD
—python3 script.py
AP_SETUP_CMD
—pip3 install -r requirements.txt
© 2015 nb.io, LLC