Documentation
¶
Overview ¶
Package github reads repo settings: branch protection and rulesets merged into effective rules, environments, plan limits and repo tarballs.
Index ¶
- Constants
- type Connector
- func (c *Connector) Available(s connector.Scope) (bool, string)
- func (c *Connector) Collect(ctx context.Context, _ connector.Collection, s connector.Scope, ...) error
- func (c *Connector) Collections() []connector.Collection
- func (c *Connector) ExportRulesets(ctx context.Context, s connector.Scope) (string, int, error)
- func (c *Connector) RepoIsPublic(ctx context.Context, s connector.Scope, owner, repo string) (public, known bool)
- func (c *Connector) Tarball(s connector.Scope) func(ctx context.Context, repo string) (io.ReadCloser, error)
- type Export
- type RulesetExport
Constants ¶
const ExportFile = "evidence/rulesets.json"
ExportFile is where a repo admin's ruleset export lives.
const ExportMaxAge = 30 * 24 * time.Hour
ExportMaxAge is how long CI may rely on an export.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
Connector reads GitHub.
func (*Connector) Collect ¶
func (c *Connector) Collect(ctx context.Context, _ connector.Collection, s connector.Scope, out graph.Writer) error
Collect reads settings for every listed repo.
func (*Connector) Collections ¶
func (c *Connector) Collections() []connector.Collection
Collections lists what it reads.
func (*Connector) ExportRulesets ¶
ExportRulesets reads every listed repo's rulesets as the current user, who must be a repo admin for the bypass lists to be returned, and writes the export.
type Export ¶
type Export struct {
GeneratedAt time.Time `json:"generated_at"`
GeneratedBy string `json:"generated_by"`
Repos map[string]map[string]RulesetExport `json:"repos"`
}
Export is the file a repo admin commits so CI can see bypass lists.
type RulesetExport ¶
type RulesetExport struct {
Name string `json:"name"`
BypassActors []json.RawMessage `json:"bypass_actors"`
}
RulesetExport is one ruleset in an export.