Loading...
Loading...
Overview of gh-infra and command workflow (import, validate, plan, apply). Use when managing GitHub repository settings, labels, actions settings, rulesets, secrets, variables, or files declaratively via YAML manifests.
npx skill4agent add babarot/gh-infra gh-infraRepositoryRepositorySetFileFileSetRepositoryRepositorySetFileFileSetimportvalidateplanapplyimport --into| Task | Skill |
|---|---|
Write/edit | |
Write/edit | |
| Set up CI workflows and auth | |
| Pull live GitHub state back into existing manifests | |
RepositoryRepositorySetFileFileSetapiVersionkindapiVersion: gh-infra/v1
kind: Repository
metadata:
owner: <github-owner>
name: <repo-name>
spec:
# ...apiVersion: gh-infra/v1
kind: RepositorySet
metadata:
owner: <github-owner> # no "name" field
defaults: # RepositorySet: shared defaults
spec: { ... }
repositories: # RepositorySet: per-repo entries
- name: <repo-name>
spec: { ... }apiVersion: gh-infra/v1
kind: FileSet
metadata:
owner: <github-owner> # no "name" field
spec:
repositories: [...] # FileSet: target repos
files: [...] # FileSet: files to distribute---import -> edit YAML -> validate -> plan -> applygh infra import <owner/repo>gh infra validate [path...]gh infra plan [path...]--cigh infra apply [path...]--auto-approve--force-secretsvalidateplanapply.*.yaml*.yml*.yaml*.ymlgh infra plan ./repos/ ./files/../repos/--fail-on-unknownrepos/files/apiVersion: gh-infra/v1
kind: Repository
metadata:
owner: my-org
name: my-repo
spec:
visibility: public
---
apiVersion: gh-infra/v1
kind: File
metadata:
owner: my-org
name: my-repo
spec:
files:
- path: .github/CODEOWNERS
content: |
* @username
via: push