Manage GitHub repository settings
Use the github-settings-as-code package from noshiro-pf/mono.
Profile location
Profiles live under:
.mise/conf.d/devtools-github/<profile>/
Each profile mirrors the upstream repo-settings/ directory:
<profile>/
├── repository-settings/settings.json
├── rulesets/*.json
├── variables/settings.json
├── actions-settings/settings.json
├── pages/settings.json
├── environments/*.json
└── vulnerability-alerts/settings.json
A missing file means that the apply operation leaves that setting unchanged.
Profile selection
default/MUST exist.- Use
default/for a new repository when the user does not name a profile. - Use the named profile when the user names one.
- Fail if an explicit profile does not exist.
- Do not silently replace an invalid profile with
default. - Require an explicit profile when applying settings to an existing repository, unless the user explicitly chooses
default.
Create a new repository
- Create the repository with
gh repo create. - Resolve the profile. Use
defaultwhen the user did not name one. - Run
scripts/apply-profilewith the newOWNER/REPO. - Report the repository and profile.
Example:
scripts/apply-profile zenobi-us/example --profile default
Apply an existing profile
Use the helper rather than invoking repo-settings directly:
scripts/apply-profile OWNER/REPO --profile PROFILE
The helper copies the profile into a temporary repo-settings/ directory and runs the upstream CLI there. This keeps the central profile unchanged because the upstream apply command rewrites local settings with GitHub's canonical values.
Safety
- Confirm visibility changes.
- Confirm ruleset changes.
- Confirm collaborator or access changes.
- Do not store tokens in profile files.
- Do not run
backupin.mise/conf.d/devtools-github/<profile>/. - Do not describe
applyas a dry run. The upstream CLI has no plan command. - Use
--ownerand--repowhen the target repository is not the current Git remote.
Authentication
The upstream package uses the existing GitHub authentication. Run gh auth status if authentication fails.
The package requires Node >=22.22.2. The helper pins github-settings-as-code@4.0.0.