Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.
/ ghad Public archive

GitHub administration command line tool

License

Notifications You must be signed in to change notification settings

18F/ghad

Repository files navigation

ghad: The GitHub Administration Tool

CircleCI

ghad ("gad") is a command-line tool for managing a large number of GitHub repositories. It currently allows you to:

It can be run manually, or set up to run from a continuous integration system - see the CircleCI configuration.

Setup

  1. Install Node.js 10+.

  2. Create a token.

  3. Clone this repository.

  4. Set your GitHub token.

    export GITHUB_TOKEN=...
  5. View the documentation.

    npx ghad --help

Example usage

  1. Run the script as a dry run.

    npx ghad archive --org <something>
  2. To actually archive repositories:

    npx ghad archive --org <something> --apply

The --org is optional. See npx ghad archive --help for more info.

Automation

See the CircleCI automation configuration.

Warning: Keep write access to this repository restricted. The associated GitHub token is that of an Owner, so being able to run arbitrary commands in CI allows privilege escalation.

Usage in TTS

ghad is run across TTS GitHub repositories by the @tts-bot. The bot is a member of the GSA/tts-admins team. To include a repository to ghad's scope, give the GSA/tts-admins team admin access to the repository.