ghrepocfg
Declaratively export, review, and reconcile GitHub repository settings from one portable YAML file.
ghrepocfg turns repository governance into a code-reviewable contract. It manages repository behavior, custom properties, security features, GitHub Actions policy, direct collaborators, team access, repository rulesets, deployment environments, Pages, labels, autolinks, and deploy keys while keeping every proposed change visible before it is applied.
Manage deployment approvals, cloud identity claims, build retention, and release controls alongside the settings your team already reviews. Export readable variables and publishing settings with the same explicit management boundary.
Key Features
- Desired-state configuration — only fields present in YAML are managed
- Permission-aware operation — keep independent work moving, with clear warnings for inaccessible attributes
- Optional strict mode — require complete exports and verify every managed value after apply
- Reviewable drift plans — inspect every addition, modification, and removal before applying
- Safe access management — reconcile direct collaborators, pending invitations, and team permissions authoritatively
- Repository rulesets — manage branch, tag, and push rulesets without converting legacy protections
- Custom properties — export and reconcile repository metadata, including multi-select values
- Strict validation — unknown and intentionally unsupported YAML keys fail before GitHub is changed
- Idempotent apply — a compliant repository produces no mutation requests, including explicit default values that GitHub omits from ruleset responses
- Automation friendly — dry-run JSON and distinct success, failure, and drift exit codes
- Readable terminal output — semantic colors distinguish additions, changes, removals, warnings, and errors while honoring
NO_COLOR - Single binary — calls GitHub directly with no runtime dependency on the GitHub CLI
ghrepocfg manages exactly one GitHub.com repository per invocation. Use a shell loop or CI matrix when applying the same configuration to multiple repositories.
See Permissions and partial access for token requirements and --strict behavior.