From 1c74304e30ffe6950deb1f08fd171cb1390299cf Mon Sep 17 00:00:00 2001 From: Imani Manyara Date: Wed, 11 Nov 2026 12:31:43 -0500 Subject: [PATCH] Show the ruleset command with a real repository --- docs/tools/repository-rulesets.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/tools/repository-rulesets.md b/docs/tools/repository-rulesets.md index 278db3a..5c922a1 100644 --- a/docs/tools/repository-rulesets.md +++ b/docs/tools/repository-rulesets.md @@ -18,12 +18,18 @@ are listed and left out, because a required check that never reports blocks ever ## Apply or update both ```bash -laranail/packages/package-tools/scripts/apply-rulesets.sh / -laranail/packages/package-tools/scripts/apply-rulesets.sh / --apply +cd ~/Artisan/projects/opensource && laranail/packages/package-tools/scripts/apply-rulesets.sh laranail/settings ``` -- **Any repository, any directory.** The path is relative to `~/Artisan/projects/opensource`; the - repository is the argument. It works for any owner, not only laranail. +```bash +cd ~/Artisan/projects/opensource && laranail/packages/package-tools/scripts/apply-rulesets.sh laranail/settings --apply +``` + +Replace `laranail/settings` with the repository's own `owner/repo`. Do not type angle-bracket +placeholders: zsh reads `` as a redirect and stops with `parse error near '\n'`. + +- **Any repository.** The repository is the only argument, and it works for any owner, not only + laranail. - **Dry run first.** Without `--apply` both scripts print their payload and change nothing. - **Updates in place.** Each ruleset is found by name and replaced, so re-running after a workflow is added or renamed is how the required checks are refreshed. `--pr ` picks @@ -36,8 +42,8 @@ laranail/packages/package-tools/scripts/apply-rulesets.sh / --apply Read the result back: ```bash -gh api repos///rules/branches/main --jq '[.[].type]' -gh api repos///rulesets --jq '.[] | "\(.id) \(.target) \(.enforcement) \(.name)"' +gh api repos/laranail/settings/rules/branches/main --jq '[.[].type]' +gh api repos/laranail/settings/rulesets --jq '.[] | "\(.id) \(.target) \(.enforcement) \(.name)"' ``` The branch must list `deletion`, `non_fast_forward`, `pull_request` and `required_status_checks`.