Skip to content

Instantly share code, notes, and snippets.

@dotysan
Last active July 2, 2025 23:49
Show Gist options
  • Save dotysan/b2e26479978c3821b8251937096218d2 to your computer and use it in GitHub Desktop.
Save dotysan/b2e26479978c3821b8251937096218d2 to your computer and use it in GitHub Desktop.
Find all my GitHub rulesets
#!/usr/bin/env bash
#
# Find all my GitHub repositories that have rulesets.
#
# as a oneliner: `gh repo list --limit 1000|while read -r repo rest;do gh ruleset list --repo "$repo"|while read id rest;do gh ruleset view --repo "$repo" "$id";echo;done;done`
#
# If you have more than 1000 repos, adjust!
#
gh repo list --limit 1000 |while read -r repo rest
do
gh ruleset list --repo "$repo" |while read id rest
do
gh ruleset view --repo "$repo" "$id"
echo
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment