Skip to content

Commit ac6dead

Browse files
committed
Address review comments
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
1 parent 9c01d9d commit ac6dead

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

github/resource_github_actions_organization_workflow_permissions.go

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,10 @@ func resourceGithubActionsOrganizationWorkflowPermissionsCreateOrUpdate(ctx cont
134134
return handleEditWorkflowPermissionsError(ctx, err, resp)
135135
}
136136

137-
tflog.Trace(ctx, "GitHub API call completed successfully", map[string]any{
138-
"organization_slug": organizationSlug,
139-
})
140-
141-
// Calling read is necessary as the Update API returns 204 with Empty Body on success
142137
tflog.Trace(ctx, "Exiting Create/Update workflow permissions successfully", map[string]any{
143138
"organization_slug": organizationSlug,
144139
})
145-
return resourceGithubActionsOrganizationWorkflowPermissionsRead(ctx, d, meta)
140+
return nil
146141
}
147142

148143
func resourceGithubActionsOrganizationWorkflowPermissionsRead(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics {
@@ -168,12 +163,6 @@ func resourceGithubActionsOrganizationWorkflowPermissionsRead(ctx context.Contex
168163
"can_approve_pull_request_reviews": workflowPerms.CanApprovePullRequestReviews,
169164
})
170165

171-
tflog.Trace(ctx, "Setting state values", map[string]any{
172-
"organization_slug": organizationSlug,
173-
"default_workflow_permissions": workflowPerms.DefaultWorkflowPermissions,
174-
"can_approve_pull_request_reviews": workflowPerms.CanApprovePullRequestReviews,
175-
})
176-
177166
if err := d.Set("organization_slug", organizationSlug); err != nil {
178167
return diag.FromErr(err)
179168
}
@@ -215,18 +204,15 @@ func resourceGithubActionsOrganizationWorkflowPermissionsDelete(ctx context.Cont
215204
})
216205

217206
tflog.Debug(ctx, "Calling GitHub API to reset workflow permissions", map[string]any{
218-
"organization_slug": organizationSlug,
207+
"organization_slug": organizationSlug,
208+
"workflow_permissions": workflowPerms,
219209
})
220210

221211
_, resp, err := client.Actions.UpdateDefaultWorkflowPermissionsInOrganization(ctx, organizationSlug, workflowPerms)
222212
if err != nil {
223213
return handleEditWorkflowPermissionsError(ctx, err, resp)
224214
}
225215

226-
tflog.Trace(ctx, "GitHub API call completed successfully", map[string]any{
227-
"organization_slug": organizationSlug,
228-
})
229-
230216
tflog.Trace(ctx, "Exiting Delete workflow permissions successfully", map[string]any{
231217
"organization_slug": organizationSlug,
232218
})

0 commit comments

Comments
 (0)