Skip to content

Commit 6f96e9b

Browse files
committed
docs(ruleset): fix documentation errors in ruleset resources
- Add missing allowed_merge_methods field to pull_request section - Fix merge_queue fields from Required to Optional with defaults - Fix actor_id to show Optional with note about DeployKey - Add DeployKey to actor_type enum list - Add protected field to conditions.repository_name - Fix required_code_scanning_tool anchor link - Remove duplicate do_not_enforce_on_create
1 parent e8b571b commit 6f96e9b

2 files changed

Lines changed: 36 additions & 30 deletions

File tree

website/docs/r/organization_ruleset.html.markdown

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ resource "github_organization_ruleset" "example_push" {
8585
file_path_restriction {
8686
restricted_file_paths = [".github/workflows/*", "*.env"]
8787
}
88-
88+
8989
max_file_size {
9090
max_file_size = 100 # 100 MB
9191
}
92-
92+
9393
max_file_path_length {
9494
max_file_path_length = 255
9595
}
96-
96+
9797
file_extension_restriction {
9898
restricted_file_extensions = ["*.exe", "*.dll", "*.so"]
9999
}
@@ -220,25 +220,27 @@ The `rules` block supports the following:
220220

221221
- `review_draft_pull_requests` - (Optional) (Boolean) Copilot automatically reviews draft pull requests before they are marked as ready for review. Defaults to `false`.
222222

223-
* `required_reviewers` - (Optional) (Block List) Require specific reviewers to approve pull requests. Note: This feature is in beta. (see [below for nested schema](#rules.pull_request.required_reviewers))
223+
- `allowed_merge_methods` - (Required) (List of String, Min: 1) Array of merge methods to be allowed. Allowed values include `merge`, `squash`, and `rebase`. At least one must be enabled.
224+
225+
- `required_reviewers` - (Optional) (Block List) Require specific reviewers to approve pull requests. Note: This feature is in beta. (see [below for nested schema](#rulespull_requestrequired_reviewers))
224226

225227
#### rules.pull_request.required_reviewers ####
226228

227-
* `reviewer` - (Required) (Block List, Max: 1) The reviewer that must review matching files. (see [below for nested schema](#rules.pull_request.required_reviewers.reviewer))
229+
- `reviewer` - (Required) (Block List, Max: 1) The reviewer that must review matching files. (see [below for nested schema](#rulespull_requestrequired_reviewersreviewer))
228230

229-
* `file_patterns` - (Required) (List of String) File patterns (fnmatch syntax) that this reviewer must approve.
231+
- `file_patterns` - (Required) (List of String) File patterns (fnmatch syntax) that this reviewer must approve.
230232

231-
* `minimum_approvals` - (Required) (Number) Minimum number of approvals required from this reviewer. Set to 0 to make approval optional.
233+
- `minimum_approvals` - (Required) (Number) Minimum number of approvals required from this reviewer. Set to 0 to make approval optional.
232234

233235
#### rules.pull_request.required_reviewers.reviewer ####
234236

235-
* `id` - (Required) (Number) The ID of the reviewer (Team ID).
237+
- `id` - (Required) (Number) The ID of the reviewer (Team ID).
236238

237-
* `type` - (Required) (String) The type of reviewer. Currently only `Team` is supported.
239+
- `type` - (Required) (String) The type of reviewer. Currently only `Team` is supported.
238240

239241
#### rules.required_status_checks ####
240242

241-
- `required_check` - (Required) (Block Set, Min: 1) Status checks that are required. Several can be defined. (see [below for nested schema](#rulesrequired_status_checks.required_check))
243+
- `required_check` - (Required) (Block Set, Min: 1) Status checks that are required. Several can be defined. (see [below for nested schema](#rulesrequired_status_checksrequired_check))
242244

243245
- `strict_required_status_checks_policy` - (Optional) (Boolean) Whether pull requests targeting a matching branch must be tested with the latest code. This setting will not take effect unless at least one status check is enabled. Defaults to `false`.
244246

@@ -306,7 +308,7 @@ The `rules` block supports the following:
306308

307309
#### bypass_actors ####
308310

309-
- `actor_id` - (Required) (Number) The ID of the actor that can bypass a ruleset.
311+
- `actor_id` - (Optional) (Number) The ID of the actor that can bypass a ruleset. Some actor types such as `DeployKey` do not have an ID.
310312

311313
- `actor_type` (String) The type of actor that can bypass a ruleset. Can be one of: `RepositoryRole`, `Team`, `Integration`, `OrganizationAdmin`.
312314

@@ -339,8 +341,8 @@ One of `repository_id` and `repository_name` must be set for the rule to target
339341
#### conditions.repository_name ####
340342

341343
- `exclude` - (Required) (List of String) Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match.
342-
343344
- `include` - (Required) (List of String) Array of repository names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~ALL` to include all repositories.
345+
- `protected` - (Optional) (Boolean) Whether renaming of target repositories is prevented. Defaults to `false`.
344346

345347
## Attributes Reference
346348

website/docs/r/repository_ruleset.html.markdown

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ resource "github_repository_ruleset" "example_push" {
7070
file_path_restriction {
7171
restricted_file_paths = [".github/workflows/*", "*.env"]
7272
}
73-
73+
7474
max_file_size {
7575
max_file_size = 100 # 100 MB
7676
}
77-
77+
7878
max_file_path_length {
7979
max_file_path_length = 255
8080
}
81-
81+
8282
file_extension_restriction {
8383
restricted_file_extensions = ["*.exe", "*.dll", "*.so"]
8484
}
@@ -193,19 +193,19 @@ The `rules` block supports the following:
193193

194194
#### rules.merge_queue ####
195195

196-
- `check_response_timeout_minutes` - (Required) (Number)Maximum time for a required status check to report a conclusion. After this much time has elapsed, checks that have not reported a conclusion will be assumed to have failed. Defaults to `60`.
196+
- `check_response_timeout_minutes` - (Optional) (Number) Maximum time for a required status check to report a conclusion. After this much time has elapsed, checks that have not reported a conclusion will be assumed to have failed. Defaults to `60`.
197197

198-
- `grouping_strategy` - (Required) (String)When set to ALLGREEN, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to HEADGREEN, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge. Can be one of: ALLGREEN, HEADGREEN. Defaults to `ALLGREEN`.
198+
- `grouping_strategy` - (Optional) (String) When set to `ALLGREEN`, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to `HEADGREEN`, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge. Can be one of: `ALLGREEN`, `HEADGREEN`. Defaults to `ALLGREEN`.
199199

200-
- `max_entries_to_build` - (Required) (Number) Limit the number of queued pull requests requesting checks and workflow runs at the same time. Defaults to `5`.
200+
- `max_entries_to_build` - (Optional) (Number) Limit the number of queued pull requests requesting checks and workflow runs at the same time. Defaults to `5`.
201201

202-
- `max_entries_to_merge` - (Required) (Number) Limit the number of queued pull requests that will be merged together in a group. Defaults to `5`.
202+
- `max_entries_to_merge` - (Optional) (Number) Limit the number of queued pull requests that will be merged together in a group. Defaults to `5`.
203203

204-
- `merge_method` - (Required) (String) Method to use when merging changes from queued pull requests. Can be one of: MERGE, SQUASH, REBASE. Defaults to `MERGE`.
204+
- `merge_method` - (Optional) (String) Method to use when merging changes from queued pull requests. Can be one of: `MERGE`, `SQUASH`, `REBASE`. Defaults to `MERGE`.
205205

206-
- `min_entries_to_merge` - (Required) (Number) The minimum number of PRs that will be merged together in a group. Defaults to `1`.
206+
- `min_entries_to_merge` - (Optional) (Number) The minimum number of PRs that will be merged together in a group. Defaults to `1`.
207207

208-
- `min_entries_to_merge_wait_minutes` - (Required) (Number) The time merge queue should wait after the first PR is added to the queue for the minimum group size to be met. After this time has elapsed, the minimum group size will be ignored and a smaller group will be merged. Defaults to `5`.
208+
- `min_entries_to_merge_wait_minutes` - (Optional) (Number) The time merge queue should wait after the first PR is added to the queue for the minimum group size to be met. After this time has elapsed, the minimum group size will be ignored and a smaller group will be merged. Defaults to `5`.
209209

210210
#### rules.pull_request ####
211211

@@ -222,21 +222,23 @@ The `rules` block supports the following:
222222

223223
- `review_draft_pull_requests` - (Optional) (Boolean) Copilot automatically reviews draft pull requests before they are marked as ready for review. Defaults to `false`.
224224

225-
* `required_reviewers` - (Optional) (Block List) Require specific reviewers to approve pull requests. Note: This feature is in beta. (see [below for nested schema](#rules.pull_request.required_reviewers))
225+
- `allowed_merge_methods` - (Required) (List of String, Min: 1) Array of merge methods to be allowed. Allowed values include `merge`, `squash`, and `rebase`. At least one must be enabled.
226+
227+
- `required_reviewers` - (Optional) (Block List) Require specific reviewers to approve pull requests. Note: This feature is in beta. (see [below for nested schema](#rulespull_requestrequired_reviewers))
226228

227229
#### rules.pull_request.required_reviewers ####
228230

229-
* `reviewer` - (Required) (Block List, Max: 1) The reviewer that must review matching files. (see [below for nested schema](#rules.pull_request.required_reviewers.reviewer))
231+
- `reviewer` - (Required) (Block List, Max: 1) The reviewer that must review matching files. (see [below for nested schema](#rulespull_requestrequired_reviewersreviewer))
230232

231-
* `file_patterns` - (Required) (List of String) File patterns (fnmatch syntax) that this reviewer must approve.
233+
- `file_patterns` - (Required) (List of String) File patterns (fnmatch syntax) that this reviewer must approve.
232234

233-
* `minimum_approvals` - (Required) (Number) Minimum number of approvals required from this reviewer. Set to 0 to make approval optional.
235+
- `minimum_approvals` - (Required) (Number) Minimum number of approvals required from this reviewer. Set to 0 to make approval optional.
234236

235237
#### rules.pull_request.required_reviewers.reviewer ####
236238

237-
* `id` - (Required) (Number) The ID of the reviewer (Team ID).
239+
- `id` - (Required) (Number) The ID of the reviewer (Team ID).
238240

239-
* `type` - (Required) (String) The type of reviewer. Currently only `Team` is supported.
241+
- `type` - (Required) (String) The type of reviewer. Currently only `Team` is supported.
240242

241243
#### rules.required_deployments ####
242244

@@ -296,7 +298,7 @@ The `rules` block supports the following:
296298

297299
#### bypass_actors ####
298300

299-
- `actor_id` - (Number) The ID of the actor that can bypass a ruleset. If `actor_type` is `Integration`, `actor_id` is a GitHub App ID. App ID can be obtained by following instructions from the [Get an App API docs](https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#get-an-app)
301+
- `actor_id` - (Optional) (Number) The ID of the actor that can bypass a ruleset. If `actor_type` is `Integration`, `actor_id` is a GitHub App ID. App ID can be obtained by following instructions from the [Get an App API docs](https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#get-an-app). Some actor types such as `DeployKey` do not have an ID.
300302

301303
- `actor_type` (String) The type of actor that can bypass a ruleset. Can be one of: `RepositoryRole`, `Team`, `Integration`, `OrganizationAdmin`, `DeployKey`.
302304

@@ -312,7 +314,9 @@ The `rules` block supports the following:
312314

313315
#### conditions ####
314316

315-
- `ref_name` - (Required) (Block List, Min: 1, Max: 1) (see [below for nested schema](#conditionsref_name))
317+
- `ref_name` - (Optional) (Block List, Max: 1) Required for `branch` and `tag` targets. Must NOT be set for `push` targets. (see [below for nested schema](#conditionsref_name))
318+
319+
~> **Note:** For `push` targets, do not include `ref_name` in conditions. Push rulesets operate on file content, not on refs. The `conditions` block is optional for push targets.
316320

317321
#### conditions.ref_name ####
318322

0 commit comments

Comments
 (0)