MCPcopy Create free account
hub / github.com/cli/cli / SelectedRepositoryCount

Function SelectedRepositoryCount

pkg/cmd/variable/shared/shared.go:71–79  ·  view source on GitHub ↗

SelectedRepositoryCount returns how many repositories the variable is visible to, fetched from the given entrusted URL. Callers own reading the URL off the variable and writing the result back.

(apiClient *api.Client, host string, selectedReposURL safeurl.SafeURL)

Source from the content-addressed store, hash-verified

69// SelectedRepositoryCount returns how many repositories the variable is visible to, fetched from the
70// given entrusted URL. Callers own reading the URL off the variable and writing the result back.
71func SelectedRepositoryCount(apiClient *api.Client, host string, selectedReposURL safeurl.SafeURL) (int, error) {
72 response := struct {
73 TotalCount int `json:"total_count"`
74 }{}
75 if err := apiClient.REST(host, "GET", selectedReposURL.String(), nil, &response); err != nil {
76 return 0, err
77 }
78 return response.TotalCount, nil
79}

Callers 2

getRunFunction · 0.92
getOrgVariablesFunction · 0.92

Calls 2

RESTMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected