Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Plugin = struct { Name string CLIName string Description string Trigger string Flags []FlagDef Behavior []string }{ Name: "Label sync", CLIName: "labelsync", Description: "Synchronises GitHub labels across all repositories accessible to the GitHub App installation. Labels are declared in a YAML file and applied, and optionally pruned, on every run.", Trigger: "Run via `--plugin=labelsync` in CI mode, or on a schedule via the `prow-labelsync` workflow.", Flags: []FlagDef{ { Name: "overwrite", Description: "Overwrite existing labels whose color or description differs from the config.", Default: "false", }, { Name: "prune", Description: "Delete labels that exist in the repository but are not defined in the config file.", Default: "false", }, { Name: "dry_run", Description: "Log what would change without making any GitHub API mutations.", Default: "false", }, }, Behavior: []string{ "Lists all repositories accessible to the GitHub App installation; skips archived and forked repos.", "For each repository, creates any labels missing from the config.", "If `overwrite: true`, updates labels whose color or description has changed.", "If `prune: true`, deletes labels not present in the config file.", "API calls are parallelised with a concurrency limit of 50 to stay within GitHub secondary rate limits.", }, }
PluginDef is the metadata for the labelsync plugin consumed by cmd/docgen.
Functions ¶
Types ¶
type Category ¶ added in v0.3.0
type Category struct {
Name string `yaml:"name"`
CategoryColor string `yaml:"category_color,omitempty"`
Labels []CategoryLabel `yaml:"labels"`
}
type CategoryLabel ¶ added in v0.3.0
type ExtraLabel ¶ added in v0.3.0
type LabelSyncConfig ¶
type LabelSyncConfig struct {
Overwrite bool `yaml:"overwrite"`
Prune bool `yaml:"prune"` // Prune deletes labels not in the labels.yml file
DryRun bool `yaml:"dry_run"`
Categories []Category `yaml:"categories"`
ExtraLabels []ExtraLabel `yaml:"extra_labels"`
}
func GetLabelSyncConfig ¶
func GetLabelSyncConfig(logger *slog.Logger) (*LabelSyncConfig, error)
Click to show internal directories.
Click to hide internal directories.