Compare commits
4 commits
main
...
trstringer
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30875d0b33 | ||
|
|
9348590e8d | ||
|
|
1426c1b34d | ||
|
|
0990a51ff6 |
1 changed files with 7 additions and 1 deletions
|
|
@ -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 {
|
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)
|
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 {
|
if err != nil {
|
||||||
fmt.Printf("%v\n", err)
|
fmt.Printf("%v\n", err)
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue