Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 1.34 KB

README.md

File metadata and controls

44 lines (36 loc) · 1.34 KB

Here's a little repo to allow you to fork all U.S. government repos, just in case the originals disappear in the next few years.

If you have a github username and oauth key, you can fork the repos yourself. Running this script will create ~1670 new repositories in your account, so you may want to create a special account just for this. You will need a new token for the new account. When creating your token, be sure to add the repo:public_repo scope, and be sure to copy it once created, as Github will not show it to you again.

To fork all of the repos:

composer install
export GH_USERNAME='Your Username here'
export GH_OAUTH_KEY='Your OAUTH Key Here'
php run.php

To update your forked repos:

export GH_USERNAME='Your Username here'
export GH_OAUTH_KEY='Your OAUTH Key Here'
php run.php update

(Obviously you can use also some other mechanism to set the relevant environment variables.)

Note that this looks only for master branches upstream. If one doesn't exist, then the exception is caught and logged to STDOUT.

TODOs:

  • Tests
  • Error Logging.
  • Generally make it less dumb.
  • DRY up the code.
  • Update the docblocks.
  • Better organization of classes.

Requirements:

  • PHP 5.4 or greater (so you can use traits)
  • Composer