config package - github.com/ossf/allstar/pkg/config - Go Packages

Package config defines and grabs overall bot config.

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.

type RepoOptConfig struct {
	
	OptIn bool `json:"optIn"`

	
	OptOut bool `json:"optOut"`
}

RepoOptConfig is used in Allstar and policy-specific repo-level config to opt in/out of enforcement.

type ScheduleConfig struct {
	
	
	Timezone string `json:"timezone"`

	
	
	Days []string `json:"days"`
}

ScheduleConfig is used to disable notifications during specific days, such as weekends.