Skip to content

Commit d486f73

Browse files
authored
[bug, docs] Add DefaultFunc to repo ruleset required deploy env, base role IDs to docs
2 parents ed19ae8 + b007a4f commit d486f73

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

github/resource_github_repository_ruleset.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ func resourceGithubRepositoryRuleset() *schema.Resource {
162162
"required_deployment_environments": {
163163
Type: schema.TypeList,
164164
Required: true,
165+
DefaultFunc: func() (interface{}, error) { return []string{}, nil },
165166
Description: "The environments that must be successfully deployed to before branches can be merged.",
166167
Elem: &schema.Schema{
167168
Type: schema.TypeString,

website/docs/r/organization_ruleset.html.markdown

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,18 @@ The `rules` block supports the following:
178178

179179
#### bypass_actors ####
180180

181-
* `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`.
181+
* `actor_id` - (Required) (Number) The ID of the actor that can bypass a ruleset.
182182

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

185185
* `bypass_mode` - (Optional) (String) When the specified actor can bypass the ruleset. pull_request means that an actor can only bypass rules on pull requests. Can be one of: `always`, `pull_request`.
186186

187+
~>Note: at the time of writing this, the following actor types correspond to the following actor IDs:
188+
* `OrganizationAdmin` -> `1`
189+
* `RepositoryRole` (This is the actor type, the following are the base repository roles and their associated IDs.)
190+
* `maintain` -> `2`
191+
* `write` -> `4`
192+
* `admiin` -> `5`
187193

188194
#### conditions ####
189195

website/docs/r/repository_ruleset.html.markdown

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,19 @@ The `rules` block supports the following:
195195

196196
#### bypass_actors ####
197197

198-
* `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`.
198+
* `actor_id` - (Required) (Number) The ID of the actor that can bypass a ruleset.
199199

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

202202
* `bypass_mode` - (Optional) (String) When the specified actor can bypass the ruleset. pull_request means that an actor can only bypass rules on pull requests. Can be one of: `always`, `pull_request`.
203203

204+
~> Note: at the time of writing this, the following actor types correspond to the following actor IDs:
205+
* `OrganizationAdmin` -> `1`
206+
* `RepositoryRole` (This is the actor type, the following are the base repository roles and their associated IDs.)
207+
* `maintain` -> `2`
208+
* `write` -> `4`
209+
* `admiin` -> `5`
210+
204211

205212
#### conditions ####
206213

0 commit comments

Comments
 (0)