Returns the source of the ruleset in the format "owner/name (repo)" or "owner (org)"
(rs RulesetGraphQL)
| 55 | |
| 56 | // Returns the source of the ruleset in the format "owner/name (repo)" or "owner (org)" |
| 57 | func 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 | |
| 70 | func ParseRulesForDisplay(rules []RulesetRule) string { |
| 71 | var display strings.Builder |
no outgoing calls
no test coverage detected