Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twelvelabs/gh-repo-config
A GitHub CLI extension to manage repository settings
https://github.com/twelvelabs/gh-repo-config
cli gh-extension github
Last synced: 3 months ago
JSON representation
A GitHub CLI extension to manage repository settings
- Host: GitHub
- URL: https://github.com/twelvelabs/gh-repo-config
- Owner: twelvelabs
- License: mit
- Created: 2022-10-25T04:54:47.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-03T07:58:03.000Z (5 months ago)
- Last Synced: 2024-07-13T01:36:06.438Z (4 months ago)
- Topics: cli, gh-extension, github
- Language: Shell
- Homepage:
- Size: 59.6 KB
- Stars: 28
- Watchers: 3
- Forks: 3
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Repo Config
:sparkles: A GitHub (`gh`) [CLI](https://cli.github.com) extension to manage GitHub repository settings via declarative configuration.
## Installation
1. Install the `gh` CLI - see the [installation](https://github.com/cli/cli#installation)
_Installation requires a minimum version (2.0.0) of the the GitHub CLI that supports extensions._
2. Install this extension:
```sh
gh extension install twelvelabs/gh-repo-config
```## Usage
Navigate to the repo you would like to configure and run:
```sh
gh repo-config init
```This will generate a number of files in .github/config:
```text
.github/config/
├── branch-protection
│ └── main.json
├── topics.json
└── repo.json
```The JSON files are API payloads for the following endpoints:
- `./repo.json`: [Update repository](https://docs.github.com/en/rest/repos/repos#update-a-repository)
- `./topics.json`: [Replace repository topics](https://docs.github.com/en/rest/repos/repos#replace-all-repository-topics)
- `./branch-protection/${name}.json`: [Update branch protection](https://docs.github.com/en/rest/branches/branch-protection#update-branch-protection)Edit the default values to your liking. To apply the settings, run:
```sh
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 and ensure you have access to administer the repo.
- Run `gh auth status` and ensure you have a valid token.## Development
```sh
git clone [email protected]: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
```