From 5b248b89e10acd96a9d90e319c58ef80e0859264 Mon Sep 17 00:00:00 2001 From: Alexis Couvreur Date: Thu, 28 Nov 2024 14:25:16 -0500 Subject: [PATCH] fix(github_actions_repository_oidc_subject_claim_customization_template): graceful handling of 404 on read The resource github_actions_repository_oidc_subject_claim_customization_template would error when the associated repository was deleted. This change will gracefully remove the resource on 404 not found. --- ...ions_repository_oidc_subject_claim_customization_template.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/resource_github_actions_repository_oidc_subject_claim_customization_template.go b/github/resource_github_actions_repository_oidc_subject_claim_customization_template.go index 803739abe1..c9f889b793 100644 --- a/github/resource_github_actions_repository_oidc_subject_claim_customization_template.go +++ b/github/resource_github_actions_repository_oidc_subject_claim_customization_template.go @@ -95,7 +95,7 @@ func resourceGithubActionsRepositoryOIDCSubjectClaimCustomizationTemplateRead(d template, _, err := client.Actions.GetRepoOIDCSubjectClaimCustomTemplate(ctx, owner, repository) if err != nil { - return err + return deleteResourceOn404AndSwallow304OtherwiseReturnError(err, d, "actions repository oidc subject claim customization template (%s, %s)", owner, repository) } if err = d.Set("repository", repository); err != nil {