mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 11:41:27 +00:00
Fix a regression in webhook-based autoscaler (#1596)
The regression resulted in the webhook-based autoscaler be unable to find visible runner groups and therefore unable to scale up and down the target RunnerDeployment/RunnerSet at all when the webhook-based autoscaler was provided GitHub API credentials to enable the runner groups support. This fixes that. The regression was introduced via #1578 which is not released yet. Users of existing ARC releases are therefore not affected.
This commit is contained in:
@@ -273,8 +273,17 @@ func (c *Client) ListOrganizationRunnerGroupsForRepository(ctx context.Context,
|
||||
var runnerGroups []*github.RunnerGroup
|
||||
|
||||
var opts github.ListOrgRunnerGroupOptions
|
||||
|
||||
opts.PerPage = 100
|
||||
opts.VisibleToRepository = repo
|
||||
|
||||
repoName := repo
|
||||
parts := strings.Split(repo, "/")
|
||||
if len(parts) == 2 {
|
||||
repoName = parts[1]
|
||||
}
|
||||
// This must be the repo name without the owner part, so in case the repo is "myorg/myrepo" the repo name
|
||||
// passed to visible_to_repository must be "myrepo".
|
||||
opts.VisibleToRepository = repoName
|
||||
|
||||
for {
|
||||
list, res, err := c.Actions.ListOrganizationRunnerGroups(ctx, org, &opts)
|
||||
|
||||
Reference in New Issue
Block a user