integrations / terraform-provider-github

Terraform GitHub provider
https://www.terraform.io/docs/providers/github/
MIT License
887 stars 730 forks source link

[FEAT]: Support targeting dynamic list by properties in organizational rulesets #2137

Open jinkang23 opened 7 months ago

jinkang23 commented 7 months ago

Describe the need

GitHub Rest API Create an organization repository ruleset recently added support in conditions parameter to also target dynamic list by custom properties (i.e. conditions.repository_property_and_ref_name).

I'm asking to add support for this in GitHub terraform resource github_organization_ruleset. Can this support be added to the next release version? Thank you!

Here's an example of what I'm asking.

resource "github_organization_ruleset" "example" {
  name        = "example"
  target      = "branch"
  enforcement = "active"

  conditions {
    ref_name {
      include = ["~ALL"]
      exclude = []
    }

    # add new `repository_property` nested block under `conditions` block
    repository_property {
      include = ["custom-prop1","custom-prop2"]
      exclude = []
    }

  }
...
}

SDK Version

No response

API Version

2022-11-28

Relevant log output

No response

Code of Conduct

YElyousfi commented 3 months ago

Hello, I am also looking for the same functionality. Any shot this can be tackled for an upcoming release?

MariusStorhaug commented 1 month ago

To add to the desired interface, think the type should resemble that of the UI?

Property name, property value.

Moser-ss commented 1 week ago

The PR #2356 add support to use the custom properties to target repositories in a ruleset