diff --git a/.github/workflows/immediate-response.yml b/.github/workflows/immediate-response.yml index e62dae1165..fca34bda02 100644 --- a/.github/workflows/immediate-response.yml +++ b/.github/workflows/immediate-response.yml @@ -18,7 +18,7 @@ jobs: run: echo "NUMBER=${{ github.event.issue.number || github.event.pull_request.number }}" >> "$GITHUB_OUTPUT" - name: Respond to issue or PR - uses: peter-evans/create-or-update-comment@223779bc560943cb8f2aa0484a7c225c1585c597 + uses: peter-evans/create-or-update-comment@1f6c51492b7d8e91122ece56e2eb7ed38df14079 with: issue-number: ${{ steps.extract.outputs.NUMBER }} body: > diff --git a/github/resource_github_organization_ruleset.go b/github/resource_github_organization_ruleset.go index 33714ab765..7c81023f10 100644 --- a/github/resource_github_organization_ruleset.go +++ b/github/resource_github_organization_ruleset.go @@ -52,7 +52,7 @@ func resourceGithubOrganizationRuleset() *schema.Resource { "actor_id": { Type: schema.TypeInt, Required: true, - Description: "The ID of the actor that can bypass a ruleset", + Description: "The ID of the actor that can bypass a ruleset. When `actor_type` is `OrganizationAdmin`, this should be set to `1`.", }, "actor_type": { Type: schema.TypeString, @@ -83,7 +83,7 @@ func resourceGithubOrganizationRuleset() *schema.Resource { Type: schema.TypeList, Optional: true, MaxItems: 1, - Description: "Parameters for a repository ruleset ref name condition.", + Description: "Parameters for an organization ruleset condition. `ref_name` is required alongside one of `repository_name` or `repository_id`.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "ref_name": { @@ -112,10 +112,11 @@ func resourceGithubOrganizationRuleset() *schema.Resource { }, }, "repository_name": { - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - ConflictsWith: []string{"conditions.0.repository_id"}, + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + ExactlyOneOf: []string{"conditions.0.repository_id"}, + AtLeastOneOf: []string{"conditions.0.repository_id"}, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "include": { @@ -144,10 +145,9 @@ func resourceGithubOrganizationRuleset() *schema.Resource { }, }, "repository_id": { - Type: schema.TypeList, - Optional: true, - ConflictsWith: []string{"conditions.0.repository_name"}, - Description: "The repository IDs that the ruleset applies to. One of these IDs must match for the condition to pass.", + Type: schema.TypeList, + Optional: true, + Description: "The repository IDs that the ruleset applies to. One of these IDs must match for the condition to pass.", Elem: &schema.Schema{ Type: schema.TypeInt, }, diff --git a/github/resource_github_repository_ruleset.go b/github/resource_github_repository_ruleset.go index 7579884b96..02ccd79669 100644 --- a/github/resource_github_repository_ruleset.go +++ b/github/resource_github_repository_ruleset.go @@ -57,7 +57,7 @@ func resourceGithubRepositoryRuleset() *schema.Resource { "actor_id": { Type: schema.TypeInt, Required: true, - Description: "The ID of the actor that can bypass a ruleset", + Description: "The ID of the actor that can bypass a ruleset. When `actor_type` is `OrganizationAdmin`, this should be set to `1`.", }, "actor_type": { Type: schema.TypeString, diff --git a/website/docs/r/organization_ruleset.html.markdown b/website/docs/r/organization_ruleset.html.markdown index 0d63c79666..15599172dd 100644 --- a/website/docs/r/organization_ruleset.html.markdown +++ b/website/docs/r/organization_ruleset.html.markdown @@ -61,7 +61,7 @@ resource "github_organization_ruleset" "example" { * `bypass_actors` - (Optional) (Block List) The actors that can bypass the rules in this ruleset. (see [below for nested schema](#bypass_actors)) -* `conditions` - (Optional) (Block List, Max: 1) Parameters for an organization ruleset ref name condition. (see [below for nested schema](#conditions)) +* `conditions` - (Optional) (Block List, Max: 1) Parameters for an organization ruleset condition. `ref_name` is required alongside one of `repository_name` or `repository_id`. (see [below for nested schema](#conditions)) #### Rules #### @@ -178,7 +178,7 @@ The `rules` block supports the following: #### bypass_actors #### -* `actor_id` - (Required) (Number) The ID of the actor that can bypass a ruleset +* `actor_id` - (Required) (Number) The ID of the actor that can bypass a ruleset. When `actor_type` is `OrganizationAdmin`, this should be set to `1`. * `actor_type` (String) The type of actor that can bypass a ruleset. Can be one of: `RepositoryRole`, `Team`, `Integration`, `OrganizationAdmin`. diff --git a/website/docs/r/repository_ruleset.html.markdown b/website/docs/r/repository_ruleset.html.markdown index 915145a109..e904a540b8 100644 --- a/website/docs/r/repository_ruleset.html.markdown +++ b/website/docs/r/repository_ruleset.html.markdown @@ -195,7 +195,7 @@ The `rules` block supports the following: #### bypass_actors #### -* `actor_id` - (Required) (Number) The ID of the actor that can bypass a ruleset +* `actor_id` - (Required) (Number) The ID of the actor that can bypass a ruleset. When `actor_type` is `OrganizationAdmin`, this should be set to `1`. * `actor_type` (String) The type of actor that can bypass a ruleset. Can be one of: `RepositoryRole`, `Team`, `Integration`, `OrganizationAdmin`.