From da8ca3d33b14576c34a3817c49e25517a2c44cc1 Mon Sep 17 00:00:00 2001 From: Corey Lane Date: Wed, 11 Sep 2024 19:42:53 -0500 Subject: [PATCH] handle emu idp group 404 --- github/resource_github_emu_group_mapping.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/github/resource_github_emu_group_mapping.go b/github/resource_github_emu_group_mapping.go index f9c47fa689..299c7aceea 100644 --- a/github/resource_github_emu_group_mapping.go +++ b/github/resource_github_emu_group_mapping.go @@ -85,6 +85,11 @@ func resourceGithubEMUGroupMappingRead(d *schema.ResourceData, meta interface{}) group, resp, err := client.Teams.GetExternalGroup(ctx, orgName, id64) if err != nil { + if resp != nil && resp.StatusCode == 404 { + // If the group is not found, remove it from state + d.SetId("") + return nil + } return err }