✨ A GitHub (gh
) CLI extension to manage GitHub repository settings via declarative configuration.
-
Install the
gh
CLI - see the installationInstallation requires a minimum version (2.0.0) of the the GitHub CLI that supports extensions.
-
Install this extension:
gh extension install twelvelabs/gh-repo-config
Navigate to the repo you would like to configure and run:
gh repo-config init
This will generate a number of files in .github/config:
.github/config/
├── branch-protection
│ └── main.json
├── topics.json
└── repo.json
The JSON files are API payloads for the following endpoints:
./repo.json
: Update repository./topics.json
: Replace repository topics./branch-protection/${name}.json
: Update branch protection
Edit the default values to your liking. To apply the settings, run:
gh repo-config apply
Note: Your auth token will need to have appropriate access to the repo you are trying to configure. Before filing bugs, please check the following:
- Navigate to https://github.com/:owner/:repo/settings and ensure you have access to administer the repo.
- Run
gh auth status
and ensure you have a valid token.
git clone git@github.com:twelvelabs/gh-repo-config.git
cd ./gh-repo-config
# Bootstrap for local development
make setup
# Test the extension
make test
# Run the extension w/out installing
make run
# Install the extension
make install