MCPcopy
hub / github.com/cli/cli / RulesetSource

Function RulesetSource

pkg/cmd/ruleset/shared/shared.go:57–68  ·  view source on GitHub ↗

Returns the source of the ruleset in the format "owner/name (repo)" or "owner (org)"

(rs RulesetGraphQL)

Source from the content-addressed store, hash-verified

55
56// Returns the source of the ruleset in the format "owner/name (repo)" or "owner (org)"
57func RulesetSource(rs RulesetGraphQL) string {
58 var level string
59 if rs.Source.TypeName == "Repository" {
60 level = "repo"
61 } else if rs.Source.TypeName == "Organization" {
62 level = "org"
63 } else {
64 level = "unknown"
65 }
66
67 return fmt.Sprintf("%s (%s)", rs.Source.Owner, level)
68}
69
70func ParseRulesForDisplay(rules []RulesetRule) string {
71 var display strings.Builder

Callers 2

selectRulesetIDFunction · 0.92
listRunFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected