config package - github.com/ossf/allstar/pkg/config - Go Packages
Package config defines and grabs overall bot config.
- func ClearInstLoc(owner string)
- func FetchConfig(ctx context.Context, c *github.Client, owner, repo, name string, ...) error
- func GetAppConfigs(ctx context.Context, c *github.Client, owner, repo string) (*OrgConfig, *RepoConfig, *RepoConfig)
- func IsBotEnabled(ctx context.Context, c *github.Client, owner, repo string) bool
- func IsEnabled(ctx context.Context, o OrgOptConfig, orc, r RepoOptConfig, c *github.Client, ...) (bool, error)
- type ConfigLevel
- type OrgConfig
- type OrgOptConfig
- type RepoConfig
- type RepoOptConfig
- type ScheduleConfig
This section is empty.
This section is empty.
func ClearInstLoc(owner string)
Function ClearInstLoc clears any saved config locations for an org/installation.
FetchConfig grabs a yaml config file from github and writes it to out.
GetAppConfigs gets the Allstar configurations for both Org and Repo level.
IsBotEnabled determines if allstar is enabled overall on the provided repo.
IsEnabled determines if a repo is enabled by interpreting the provided org-level, org-repo-level, and repo-level OptConfigs.
ConfigLevel is an enum to indicate which level config to retrieve for the particular policy.
const ( OrgLevel ConfigLevel = iota OrgRepoLevel RepoLevel )
type OrgConfig struct {
OptConfig OrgOptConfig `json:"optConfig"`
IssueLabel string `json:"issueLabel"`
IssueRepo string `json:"issueRepo"`
IssueFooter string `json:"issueFooter"`
IssueDetails string `json:"issueDetails"`
Schedule *ScheduleConfig `json:"schedule"`
}
OrgConfig is the org-level config definition for Allstar.
type OrgOptConfig struct {
OptOutStrategy bool `json:"optOutStrategy"`
OptInRepos []string `json:"optInRepos"`
OptOutRepos []string `json:"optOutRepos"`
OptOutPrivateRepos bool `json:"optOutPrivateRepos"`
OptOutPublicRepos bool `json:"optOutPublicRepos"`
OptOutArchivedRepos bool `json:"optOutArchivedRepos"`
OptOutForkedRepos bool `json:"optOutForkedRepos"`
DisableRepoOverride bool `json:"disableRepoOverride"`
}
OrgOptConfig is used in Allstar and policy-specific org-level config to define the opt in/out configuration.
type RepoConfig struct {
OptConfig RepoOptConfig `json:"optConfig"`
IssueLabel string `json:"issueLabel"`
Schedule *ScheduleConfig `json:"schedule"`
}
RepoConfig is the repo-level config definition for Allstar.
RepoOptConfig is used in Allstar and policy-specific repo-level config to opt in/out of enforcement.