New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for repository rulesets #7650
Conversation
Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requested some very minor changes; otherwise it's looking great. thank you for the awesome work.
This is frustrating but might be worth it in order to support Alternatively, can we support |
@vilmibm This is theoretically possible, but several of the fields are paginated, and many of them require more fields underneath that may change:
Based on this, I think the only feasible way to add support would be to use the REST API, since those top-level fields will rarely change. Nothing else in the CLI uses the REST API for that command though. There's just too much weird behavior with this GraphQL setup because rulesets are a bit unique, it's not really feasible. |
Repository rulesets are a new GitHub feature, essentially the evolution of branch protections. This PR adds support for them via a new command (
ruleset
/rs
) with 3 subcommands.rs list
: Lists rulesets for the provided repo or orgrs view <id>
: View info about a specific ruleset by ID, or choose interactivelyrs check <branch>
: List the rules that apply to the given branch in a repoSample output
List:
View:
Check:
Notes
--json
flag for that same reason, as it seems to require using the GraphQL API and providing a list of supported fields, which would continue to tie them together. I'd love to add support if it's possible!