Compare commits

...
Sign in to create a new pull request.

4 commits

Author SHA1 Message Date
Thomas Stringer
30875d0b33
Change variable name
Signed-off-by: Thomas Stringer <thomas@trstringer.com>
2022-11-11 17:52:24 -05:00
Thomas Stringer
9348590e8d
Change image repo back from testing
Signed-off-by: Thomas Stringer <thomas@trstringer.com>
2022-11-11 17:50:53 -05:00
Thomas Stringer
1426c1b34d
Revert image change for testing
Signed-off-by: Thomas Stringer <thomas@trstringer.com>
2022-11-11 17:49:53 -05:00
Thomas Stringer
0990a51ff6
Fix bug where team is not found with periods
Signed-off-by: Thomas Stringer <thomas@trstringer.com>
2022-11-11 17:18:12 -05:00

View file

@ -58,7 +58,13 @@ func retrieveApprovers(client *github.Client, repoOwner string) ([]string, error
func expandGroupFromUser(client *github.Client, org, userOrTeam string, workflowInitiator string, shouldExcludeWorkflowInitiator bool) []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{})
// GitHub replaces periods in the team name with hyphens. If a period is
// passed to the request it would result in a 404. So we need to replace
// and occurrences with a hyphen.
formattedUserOrTeam := strings.ReplaceAll(userOrTeam, ".", "-")
users, _, err := client.Teams.ListTeamMembersBySlug(context.Background(), org, formattedUserOrTeam, &github.TeamListTeamMembersOptions{})
if err != nil {
fmt.Printf("%v\n", err)
return nil