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

Function getEnterpriseOrganizationAndRepo

github/github.go:401–413  ·  view source on GitHub ↗

Validates enterprise, organization and repo arguments. Both are optional, but at least one should be specified

(enterprise, org, repo string)

Source from the content-addressed store, hash-verified

399
400// Validates enterprise, organization and repo arguments. Both are optional, but at least one should be specified
401func getEnterpriseOrganizationAndRepo(enterprise, org, repo string) (string, string, string, error) {
402 if len(repo) > 0 {
403 owner, repository, err := splitOwnerAndRepo(repo)
404 return "", owner, repository, err
405 }
406 if len(org) > 0 {
407 return "", org, "", nil
408 }
409 if len(enterprise) > 0 {
410 return enterprise, "", "", nil
411 }
412 return "", "", "", fmt.Errorf("enterprise, organization and repository are all empty")
413}
414
415func getRegistrationKey(org, repo, enterprise string) string {
416 return fmt.Sprintf("org=%s,repo=%s,enterprise=%s", org, repo, enterprise)

Callers 3

GetRegistrationTokenMethod · 0.85
RemoveRunnerMethod · 0.85
ListRunnersMethod · 0.85

Calls 2

splitOwnerAndRepoFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected