MCPcopy Create free account
hub / github.com/actions/actions-runner-controller / ListRunners

Method ListRunners

github/github.go:226–251  ·  view source on GitHub ↗

ListRunners returns a list of runners of specified owner/repository name.

(ctx context.Context, enterprise, org, repo string)

Source from the content-addressed store, hash-verified

224
225// ListRunners returns a list of runners of specified owner/repository name.
226func (c *Client) ListRunners(ctx context.Context, enterprise, org, repo string) ([]*github.Runner, error) {
227 enterprise, owner, repo, err := getEnterpriseOrganizationAndRepo(enterprise, org, repo)
228
229 if err != nil {
230 return nil, err
231 }
232
233 var runners []*github.Runner
234
235 opts := github.ListOptions{PerPage: 100}
236 for {
237 list, res, err := c.listRunners(ctx, enterprise, owner, repo, &opts)
238
239 if err != nil {
240 return runners, fmt.Errorf("failed to list runners: %w", err)
241 }
242
243 runners = append(runners, list.Runners...)
244 if res.NextPage == 0 {
245 break
246 }
247 opts.Page = res.NextPage
248 }
249
250 return runners, nil
251}
252
253// ListOrganizationRunnerGroupsForRepository returns all the runner groups defined in the organization and
254// inherited to the organization from an enterprise.

Callers 6

IsRunnerBusyMethod · 0.95
getRunnerFunction · 0.80
listRunnersMethod · 0.80
TestListRunnersFunction · 0.80

Implementers 1

Clientcontrollers/actions.github.com/multicl

Calls 3

listRunnersMethod · 0.95
ErrorfMethod · 0.45

Tested by 2

TestListRunnersFunction · 0.64