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:
Yusuke Kuoka
2022-08-24 13:08:40 +09:00
committed by GitHub
parent 5116e3800e
commit bdcde44642
20 changed files with 36 additions and 158 deletions

View File

@@ -8,7 +8,7 @@ import (
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/google/go-github/v45/github"
"github.com/google/go-github/v47/github"
"github.com/gorilla/mux"
)

View File

@@ -15,7 +15,7 @@ import (
"github.com/actions-runner-controller/actions-runner-controller/logging"
"github.com/bradleyfalzon/ghinstallation/v2"
"github.com/go-logr/logr"
"github.com/google/go-github/v45/github"
"github.com/google/go-github/v47/github"
"github.com/gregjones/httpcache"
"golang.org/x/oauth2"
)
@@ -243,29 +243,6 @@ func (c *Client) ListRunners(ctx context.Context, enterprise, org, repo string)
return runners, nil
}
// ListOrganizationRunnerGroups returns all the runner groups defined in the organization and
// inherited to the organization from an enterprise.
func (c *Client) ListOrganizationRunnerGroups(ctx context.Context, org string) ([]*github.RunnerGroup, error) {
var runnerGroups []*github.RunnerGroup
opts := github.ListOrgRunnerGroupOptions{}
opts.PerPage = 100
for {
list, res, err := c.Client.Actions.ListOrganizationRunnerGroups(ctx, org, &opts)
if err != nil {
return runnerGroups, fmt.Errorf("failed to list organization runner groups: %w", err)
}
runnerGroups = append(runnerGroups, list.RunnerGroups...)
if res.NextPage == 0 {
break
}
opts.Page = res.NextPage
}
return runnerGroups, nil
}
// ListOrganizationRunnerGroupsForRepository returns all the runner groups defined in the organization and
// inherited to the organization from an enterprise.
// We can remove this when google/go-github library is updated to support this.

View File

@@ -8,7 +8,7 @@ import (
"time"
"github.com/actions-runner-controller/actions-runner-controller/github/fake"
"github.com/google/go-github/v45/github"
"github.com/google/go-github/v47/github"
)
var server *httptest.Server