Skip to content

Commit 52d95d4

Browse files
committed
Fix linter issues
Signed-off-by: Timo Sand <[email protected]>
1 parent efd67ae commit 52d95d4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

github/resource_github_organization_ruleset.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -735,20 +735,20 @@ func resourceGithubOrganizationRulesetImport(ctx context.Context, d *schema.Reso
735735
return []*schema.ResourceData{d}, nil
736736
}
737737

738-
func validateConditionsFieldForBranchAndTagTargets(ctx context.Context, d *schema.ResourceDiff, meta any) error {
738+
func validateConditionsFieldForBranchAndTagTargets(ctx context.Context, d *schema.ResourceDiff, _ any) error {
739739
target := d.Get("target").(string)
740740
conditions := d.Get("conditions").([]any)[0].(map[string]any)
741741
tflog.Debug(ctx, "Validating conditions field for branch and tag targets", map[string]any{"target": target, "conditions": conditions})
742742
if conditions["ref_name"] == nil || len(conditions["ref_name"].([]any)) == 0 {
743743
return fmt.Errorf("ref_name must be set for %s target", target)
744744
}
745745
if (conditions["repository_name"] == nil || len(conditions["repository_name"].([]any)) == 0) && (conditions["repository_id"] == nil || len(conditions["repository_id"].([]any)) == 0) {
746-
return fmt.Errorf("Either repository_name or repository_id must be set for %s target", target)
746+
return fmt.Errorf("either repository_name or repository_id must be set for %s target", target)
747747
}
748748
return nil
749749
}
750750

751-
func validateConditionsFieldForPushTarget(ctx context.Context, d *schema.ResourceDiff, meta any) error {
751+
func validateConditionsFieldForPushTarget(ctx context.Context, d *schema.ResourceDiff, _ any) error {
752752
target := d.Get("target").(string)
753753
conditions := d.Get("conditions").([]any)[0].(map[string]any)
754754
tflog.Debug(ctx, "Validating conditions field for push target", map[string]any{"target": target, "conditions": conditions})
@@ -759,7 +759,7 @@ func validateConditionsFieldForPushTarget(ctx context.Context, d *schema.Resourc
759759
return nil
760760
}
761761

762-
func validateConditionsFieldForRepositoryTarget(ctx context.Context, d *schema.ResourceDiff, meta any) error {
762+
func validateConditionsFieldForRepositoryTarget(ctx context.Context, d *schema.ResourceDiff, _ any) error {
763763
target := d.Get("target").(string)
764764
conditions := d.Get("conditions").([]any)[0].(map[string]any)
765765
tflog.Debug(ctx, "Validating conditions field for repository target", map[string]any{"target": target, "conditions": conditions})
@@ -778,7 +778,7 @@ func validateConditionsFieldBasedOnTarget(ctx context.Context, d *schema.Resourc
778778
tflog.Debug(ctx, "Validating conditions field based on target", map[string]any{"target": target})
779779
conditionsRaw := d.Get("conditions").([]any)
780780

781-
if conditionsRaw == nil || len(conditionsRaw) == 0 {
781+
if len(conditionsRaw) == 0 {
782782
tflog.Debug(ctx, "An empty conditions block, skipping validation.", map[string]any{"target": target})
783783
return nil
784784
}

github/respository_rules_utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ func flattenBypassActors(bypassActors []*github.BypassActor) []any {
136136
actorID := v.GetActorID()
137137
actorType := v.GetActorType()
138138
if *actorType == github.BypassActorTypeOrganizationAdmin && actorID == 0 {
139-
// This is a workaround for the GitHub API bug where OrganizationAdmin actor_id is returned as `null` instead of `1`
140-
log.Printf("[DEBUG] Setting OrganizationAdmin Actor ID to 1")
139+
// This is a workaround for the GitHub API bug where OrganizationAdmin actor_id is returned as `null` instead of `1`
140+
log.Printf("[DEBUG] Setting OrganizationAdmin Actor ID to 1")
141141
actorID = 1
142142
}
143143
actorMap["actor_id"] = actorID

0 commit comments

Comments
 (0)