Create GitHub pull requests automatically.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Procfile minimal Procfile for a web instance Feb 12, 2018
README.md Update path Jun 27, 2016
app.json Update path Jun 27, 2016
autopull use git add --all to handle removals: Feb 12, 2018
requirements.txt Fake Python app. May 27, 2015

README.md

autopull

Bash script that auto-creates Pull Requests for a given repo.

How it works

  1. Clones the to-be-updated repo (AP_REPO) into a tmp dir
  2. Does stuff (AP_CMD)
  3. Creates a PR for the changes
  4. Profit!

Configuration

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 of user/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 and GIT_COMMITTER_NAME — Name of the user or robot doing the committing. Both must be set.
  • GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL — Email address of the user or robot doing the committing. Both must be set.

Heroku quickstart

  1. Clone (or fork) this repository
  2. Create a Heroku app, which will run the autopull script
  3. Set the above environment variables
  4. Add the Heroku Scheduler add-on: heroku addons:create scheduler:standard
  5. Configure the work schedule: heroku addons:open scheduler and command to run (./autopull)
  6. Push your fork to Heroku: git push {your Heroku app's git remote}
  7. Test: heroku run ./autopull -a {your Heroku app name}

Deploy

Python example

  • AP_CMDpython3 script.py
  • AP_SETUP_CMDpip3 install -r requirements.txt

Credits

© 2015 nb.io, LLC