Skip to content

Commit e2b8db9

Browse files
committed
Add allowed_merge_methods to rules for Org & Repo rulesets
This is a required field and the SDK doesn't omit if it's empty Signed-off-by: Timo Sand <[email protected]>
1 parent bc40d00 commit e2b8db9

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

github/resource_github_organization_ruleset.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,16 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
198198
Description: "Require all commits be made to a non-target branch and submitted via a pull request before they can be merged.",
199199
Elem: &schema.Resource{
200200
Schema: map[string]*schema.Schema{
201+
"allowed_merge_methods": {
202+
Type: schema.TypeList,
203+
Required: true,
204+
MinItems: 1,
205+
Description: "Array of allowed merge methods. Allowed values include `merge`, `squash`, and `rebase`. At least one option must be enabled.",
206+
Elem: &schema.Schema{
207+
Type: schema.TypeString,
208+
ValidateDiagFunc: toDiagFunc(validation.StringInSlice([]string{"merge", "squash", "rebase"}, false), "allowed_merge_methods"),
209+
},
210+
},
201211
"dismiss_stale_reviews_on_push": {
202212
Type: schema.TypeBool,
203213
Optional: true,

github/resource_github_repository_ruleset.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,16 @@ func resourceGithubRepositoryRuleset() *schema.Resource {
189189
Description: "Require all commits be made to a non-target branch and submitted via a pull request before they can be merged.",
190190
Elem: &schema.Resource{
191191
Schema: map[string]*schema.Schema{
192+
"allowed_merge_methods": {
193+
Type: schema.TypeList,
194+
Required: true,
195+
MinItems: 1,
196+
Description: "Array of allowed merge methods. Allowed values include `merge`, `squash`, and `rebase`. At least one option must be enabled.",
197+
Elem: &schema.Schema{
198+
Type: schema.TypeString,
199+
ValidateDiagFunc: toDiagFunc(validation.StringInSlice([]string{"merge", "squash", "rebase"}, false), "allowed_merge_methods"),
200+
},
201+
},
192202
"dismiss_stale_reviews_on_push": {
193203
Type: schema.TypeBool,
194204
Optional: true,

0 commit comments

Comments
 (0)