Skip to content

Commit 5d9d8a1

Browse files
committed
Address review comments
Signed-off-by: Timo Sand <[email protected]>
1 parent b276c34 commit 5d9d8a1

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

github/resource_github_organization_ruleset.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
2727

2828
SchemaVersion: 1,
2929

30-
CustomizeDiff: resourceGithubOrganizationRulesetValidate,
30+
CustomizeDiff: resourceGithubOrganizationRulesetDiff,
3131

3232
Schema: map[string]*schema.Schema{
3333
"name": {
@@ -39,7 +39,7 @@ func resourceGithubOrganizationRuleset() *schema.Resource {
3939
"target": {
4040
Type: schema.TypeString,
4141
Required: true,
42-
// The API accepts an `repository` target, but any rule created with that doesn't show up in the UI, nor does it have any rules.
42+
// The API accepts an `repository` target, but we don't support it yet.
4343
ValidateFunc: validation.StringInSlice([]string{string(TargetBranch), string(TargetTag), string(TargetPush)}, false),
4444
Description: "The target of the ruleset. Possible values are `branch`, `tag` and `push`.",
4545
},
@@ -863,7 +863,7 @@ func resourceGithubOrganizationRulesetImport(ctx context.Context, d *schema.Reso
863863
return []*schema.ResourceData{d}, nil
864864
}
865865

866-
func resourceGithubOrganizationRulesetValidate(ctx context.Context, d *schema.ResourceDiff, _ any) error {
866+
func resourceGithubOrganizationRulesetDiff(ctx context.Context, d *schema.ResourceDiff, _ any) error {
867867
err := validateRulesetConditions(ctx, d, true)
868868
if err != nil {
869869
return err

github/resource_github_repository_ruleset.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package github
33
import (
44
"context"
55
"errors"
6+
"fmt"
67
"net/http"
78
"regexp"
89
"strconv"
@@ -26,7 +27,7 @@ func resourceGithubRepositoryRuleset() *schema.Resource {
2627

2728
SchemaVersion: 1,
2829

29-
CustomizeDiff: resourceGithubRepositoryRulesetValidate,
30+
CustomizeDiff: resourceGithubRepositoryRulesetDiff,
3031

3132
Schema: map[string]*schema.Schema{
3233
"name": {
@@ -792,7 +793,7 @@ func resourceGithubRepositoryRulesetImport(ctx context.Context, d *schema.Resour
792793
return []*schema.ResourceData{d}, nil
793794
}
794795

795-
func resourceGithubRepositoryRulesetValidate(ctx context.Context, d *schema.ResourceDiff, meta any) error {
796+
func resourceGithubRepositoryRulesetDiff(ctx context.Context, d *schema.ResourceDiff, meta any) error {
796797
err := validateRulesetConditions(ctx, d, false)
797798
if err != nil {
798799
return err

0 commit comments

Comments
 (0)