mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 03:13:15 +00:00
chore: Bump go-github and minimum GHES version to 3.6 (#1747)
Ref https://github.com/actions-runner-controller/actions-runner-controller/issues/1574
This commit is contained in:
@@ -20,51 +20,23 @@ func (c *Simulator) GetRunnerGroupsVisibleToRepository(ctx context.Context, org,
|
||||
panic(fmt.Sprintf("BUG: owner should not be empty in this context. repo=%v", repo))
|
||||
}
|
||||
|
||||
if c.Client.GithubBaseURL == "https://github.com/" {
|
||||
runnerGroups, err := c.Client.ListOrganizationRunnerGroupsForRepository(ctx, org, repo)
|
||||
if err != nil {
|
||||
return visible, err
|
||||
runnerGroups, err := c.Client.ListOrganizationRunnerGroupsForRepository(ctx, org, repo)
|
||||
if err != nil {
|
||||
return visible, err
|
||||
}
|
||||
|
||||
if c.Log.V(3).Enabled() {
|
||||
c.Log.V(3).Info("ListOrganizationRunnerGroupsForRepository succeeded", "runerGroups", runnerGroups)
|
||||
}
|
||||
|
||||
for _, runnerGroup := range runnerGroups {
|
||||
ref := NewRunnerGroupFromGitHub(runnerGroup)
|
||||
|
||||
if !managed.Includes(ref) {
|
||||
continue
|
||||
}
|
||||
|
||||
if c.Log.V(3).Enabled() {
|
||||
c.Log.V(3).Info("ListOrganizationRunnerGroupsForRepository succeeded", "runerGroups", runnerGroups)
|
||||
}
|
||||
|
||||
for _, runnerGroup := range runnerGroups {
|
||||
ref := NewRunnerGroupFromGitHub(runnerGroup)
|
||||
|
||||
if !managed.Includes(ref) {
|
||||
continue
|
||||
}
|
||||
|
||||
visible.Add(ref)
|
||||
}
|
||||
} else {
|
||||
runnerGroups, err := c.Client.ListOrganizationRunnerGroups(ctx, org)
|
||||
if err != nil {
|
||||
return visible, err
|
||||
}
|
||||
|
||||
for _, runnerGroup := range runnerGroups {
|
||||
ref := NewRunnerGroupFromGitHub(runnerGroup)
|
||||
|
||||
if !managed.Includes(ref) {
|
||||
continue
|
||||
}
|
||||
|
||||
if runnerGroup.GetVisibility() != "all" {
|
||||
hasAccess, err := c.hasRepoAccessToOrganizationRunnerGroup(ctx, org, runnerGroup.GetID(), repo)
|
||||
if err != nil {
|
||||
return visible, err
|
||||
}
|
||||
|
||||
if !hasAccess {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
visible.Add(ref)
|
||||
}
|
||||
visible.Add(ref)
|
||||
}
|
||||
|
||||
return visible, nil
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/google/go-github/v45/github"
|
||||
"github.com/google/go-github/v47/github"
|
||||
)
|
||||
|
||||
type RunnerGroupScope int
|
||||
|
||||
Reference in New Issue
Block a user