wrappers for github functions (switch between enterprise/organization/repository mode) so the calling functions don't need to switch and their code is a bit cleaner
(ctx context.Context, enterprise, org, repo string)
| 322 | // so the calling functions don't need to switch and their code is a bit cleaner |
| 323 | |
| 324 | func (c *Client) createRegistrationToken(ctx context.Context, enterprise, org, repo string) (*github.RegistrationToken, *github.Response, error) { |
| 325 | if len(repo) > 0 { |
| 326 | return c.Actions.CreateRegistrationToken(ctx, org, repo) |
| 327 | } |
| 328 | if len(org) > 0 { |
| 329 | return c.Actions.CreateOrganizationRegistrationToken(ctx, org) |
| 330 | } |
| 331 | return c.Enterprise.CreateRegistrationToken(ctx, enterprise) |
| 332 | } |
| 333 | |
| 334 | func (c *Client) removeRunner(ctx context.Context, enterprise, org, repo string, runnerID int64) (*github.Response, error) { |
| 335 | if len(repo) > 0 { |
no outgoing calls
no test coverage detected