Skip to content

Commit 57f640d

Browse files
authored
Merge branch 'main' into dependabot/github_actions/goreleaser/goreleaser-action-5
2 parents 3526a0c + d486f73 commit 57f640d

File tree

6 files changed

+30
-16
lines changed

6 files changed

+30
-16
lines changed

.github/workflows/immediate-response.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: echo "NUMBER=${{ github.event.issue.number || github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
1919

2020
- name: Respond to issue or PR
21-
uses: peter-evans/create-or-update-comment@223779bc560943cb8f2aa0484a7c225c1585c597
21+
uses: peter-evans/create-or-update-comment@1f6c51492b7d8e91122ece56e2eb7ed38df14079
2222
with:
2323
issue-number: ${{ steps.extract.outputs.NUMBER }}
2424
body: >

github/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ func tokenFromGhCli(baseURL string) (string, error) {
398398
}
399399
hostname := ""
400400
if baseURL == "" {
401-
hostname = "api.github.com"
401+
hostname = "github.com"
402402
} else {
403403
parsedURL, err := url.Parse(baseURL)
404404
if err != nil {

github/resource_github_organization_ruleset.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
5252
"actor_id": {
5353
Type: schema.TypeInt,
5454
Required: true,
55-
Description: "The ID of the actor that can bypass a ruleset",
55+
Description: "The ID of the actor that can bypass a ruleset. When `actor_type` is `OrganizationAdmin`, this should be set to `1`.",
5656
},
5757
"actor_type": {
5858
Type: schema.TypeString,
@@ -83,7 +83,7 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
8383
Type: schema.TypeList,
8484
Optional: true,
8585
MaxItems: 1,
86-
Description: "Parameters for a repository ruleset ref name condition.",
86+
Description: "Parameters for an organization ruleset condition. `ref_name` is required alongside one of `repository_name` or `repository_id`.",
8787
Elem: &schema.Resource{
8888
Schema: map[string]*schema.Schema{
8989
"ref_name": {
@@ -112,10 +112,11 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
112112
},
113113
},
114114
"repository_name": {
115-
Type: schema.TypeList,
116-
Optional: true,
117-
MaxItems: 1,
118-
ConflictsWith: []string{"conditions.0.repository_id"},
115+
Type: schema.TypeList,
116+
Optional: true,
117+
MaxItems: 1,
118+
ExactlyOneOf: []string{"conditions.0.repository_id"},
119+
AtLeastOneOf: []string{"conditions.0.repository_id"},
119120
Elem: &schema.Resource{
120121
Schema: map[string]*schema.Schema{
121122
"include": {
@@ -144,10 +145,9 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
144145
},
145146
},
146147
"repository_id": {
147-
Type: schema.TypeList,
148-
Optional: true,
149-
ConflictsWith: []string{"conditions.0.repository_name"},
150-
Description: "The repository IDs that the ruleset applies to. One of these IDs must match for the condition to pass.",
148+
Type: schema.TypeList,
149+
Optional: true,
150+
Description: "The repository IDs that the ruleset applies to. One of these IDs must match for the condition to pass.",
151151
Elem: &schema.Schema{
152152
Type: schema.TypeInt,
153153
},

github/resource_github_repository_ruleset.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func resourceGithubRepositoryRuleset() *schema.Resource {
5757
"actor_id": {
5858
Type: schema.TypeInt,
5959
Required: true,
60-
Description: "The ID of the actor that can bypass a ruleset",
60+
Description: "The ID of the actor that can bypass a ruleset. When `actor_type` is `OrganizationAdmin`, this should be set to `1`.",
6161
},
6262
"actor_type": {
6363
Type: schema.TypeString,
@@ -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: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ resource "github_organization_ruleset" "example" {
6161

6262
* `bypass_actors` - (Optional) (Block List) The actors that can bypass the rules in this ruleset. (see [below for nested schema](#bypass_actors))
6363

64-
* `conditions` - (Optional) (Block List, Max: 1) Parameters for an organization ruleset ref name condition. (see [below for nested schema](#conditions))
64+
* `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))
6565

6666
#### Rules ####
6767

@@ -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
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
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)