Skip to content

Commit d09bfd4

Browse files
authored
fix(environments): swallow 404 not found errors (#3132)
When an environment no longer exist, the deletion call should not throw back an error. The resource is in the desired state, gone.
1 parent bbf7abb commit d09bfd4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

github/resource_github_repository_environment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ func resourceGithubRepositoryEnvironmentDelete(ctx context.Context, d *schema.Re
240240

241241
_, err = client.Repositories.DeleteEnvironment(ctx, owner, repoName, url.PathEscape(envName))
242242
if err != nil {
243-
return diag.FromErr(err)
243+
return diag.FromErr(deleteResourceOn404AndSwallow304OtherwiseReturnError(err, d, "environment (%s)", envName))
244244
}
245245

246246
return nil

0 commit comments

Comments
 (0)