From 8cbc88a78cc3f0ca28bf0ebbad9c3e1f32dab20b Mon Sep 17 00:00:00 2001 From: Thomas Stringer Date: Thu, 14 Jul 2022 22:29:36 -0400 Subject: [PATCH] Troubleshoot and log failed group expansion (#34) Currently group expansion is failing. I suspect this is due to workflow permissions, as this succeeds locally. This additional logging should show unexpected errors that aren't just a non-group expansion. --- approvers.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/approvers.go b/approvers.go index 22bfc32..922948a 100644 --- a/approvers.go +++ b/approvers.go @@ -45,8 +45,10 @@ func retrieveApprovers(client *github.Client, repoOwner string) ([]string, error } func expandGroupFromUser(client *github.Client, org, userOrTeam string) []string { + fmt.Printf("Attempting to expand user %s/%s as a group (may not succeed)\n", org, userOrTeam) users, _, err := client.Teams.ListTeamMembersBySlug(context.Background(), org, userOrTeam, &github.TeamListTeamMembersOptions{}) - if err != nil || len(users) == 0 { + if err != nil { + fmt.Printf("%v\n", err) return nil }