From 2c5b3af1c4376e01f83cd816c1136bfbf0aa9b81 Mon Sep 17 00:00:00 2001 From: Corey Lane Date: Fri, 13 Sep 2024 12:48:15 -0500 Subject: [PATCH] handle emu idp group 404 (#2385) Co-authored-by: Corey Lane --- 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 f9c47fa68..299c7acee 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 }