Skip to content
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

[FEAT]: Support property based conditions for github_organization_ruleset #2594

Open
1 task done
secustor opened this issue Mar 13, 2025 · 0 comments
Open
1 task done
Labels
Status: Triage This is being looked at and prioritized Type: Feature New feature or request

Comments

@secustor
Copy link

Describe the need

Currently only a static repository list are allowed.

With this it would be possible to define dynamic lists of repositories based on properties of repositories in the organization

The following will apply a rule to all repositories which are not public

JSON representation of such a ruleset
{
  "id": 1111111,
  "name": "test",
  "target": "branch",
  "source_type": "Organization",
  "source": "foo",
  "enforcement": "evaluate",
  "conditions": {
    "ref_name": {
      "exclude": [],
      "include": [
        "~DEFAULT_BRANCH"
      ]
    },
    "repository_property": {
      "exclude": [
        {
          "name": "visibility",
          "source": "system",
          "property_values": [
            "public"
          ]
        }
      ],
      "include": []
    }
  },
  "rules": [
    {
      "type": "workflows",
      "parameters": {
        "do_not_enforce_on_create": true,
        "workflows": [
          {
            "repository_id": 0000000,
            "path": ".github/workflows/bar.yml",
            "ref": "refs/heads/main"
          }
        ]
      }
    }
  ],
  "node_id": "xxxxxxxxxxxx",
  "created_at": "2025-03-13T16:27:00.269+01:00",
  "updated_at": "2025-03-13T16:27:00.269+01:00",
  "bypass_actors": [],
  "_links": {
    "self": {
      "href": "https://api.github.com/orgs/n26/rulesets/1111111"
    },
    "html": {
      "href": "http://github.com/organizations/n26/settings/rules/1111111"
    }
  }
}

API endpoint: https://docs.github.com/en/rest/orgs/rules?apiVersion=2022-11-28#create-an-organization-repository-ruleset

SDK Version

No response

API Version

2022-11-28

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct
@secustor secustor added Status: Triage This is being looked at and prioritized Type: Feature New feature or request labels Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant