Skip to content

Add repository ruleset management functions #63

Open

Description

Rulesets control how people can interact with selected branches and tags in a repository.

https://docs.github.com/en/rest/repos/rules?apiVersion=2022-11-28

Activity

  1. converted this from a draft issue on Oct 7, 2023
  2. changed the title [-][Feature] Repositories - Rules - Manage rulesets for repositories[/-] [+]Add repository ruleset management functions[/+] on Apr 4, 2026
  3. MariusStorhaug commented on Jul 25, 2026

    @MariusStorhaug
    MemberAuthor

    Flagging a sibling scope for this area, driven by MSXOrg/Custo (PR #1), which maintains rulesets centrally as an enterprise control:

    • Repository rulesets — …/repos/{owner}/{repo}/rulesets (this issue).
    • Organization rulesets — …/orgs/{org}/rulesets.
    • Enterprise rulesets — …/enterprises/{enterprise}/rulesets.

    The three share a payload shape but differ by scope. Worth deciding whether they live under one set of *-GitHubRuleset cmdlets parameterized by scope, or per-scope cmdlets (*-GitHubRepositoryRuleset, *-GitHubOrganizationRuleset, *-GitHubEnterpriseRuleset).

    Auth note: enterprise rulesets require enterprise-admin authorization. GitHub Apps generally cannot manage enterprise rulesets, so a PAT with admin:enterprise is needed there — the cmdlet should accept whichever -Context token is supplied and error clearly when the scope is insufficient.

    Note this is distinct from Get-GitHubRepositoryRuleSuite (rule evaluation results) — this issue is about managing ruleset definitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions