config

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIgnoredPaths

func GetIgnoredPaths(repo string) ([]string, error)

GetIgnoredPaths returns the path patterns that don't require any checks for the given repo: the repo's own IgnoredPaths if set, otherwise the global ones.

func GetKnownTrigger

func GetKnownTrigger(check string) string

GetKnownTrigger returns the PR comment trigger for the given check run name, or an empty string if none is configured.

Check names are matched exactly first. Checks with a dynamic suffix (e.g. the per-provider "App E2E Test Suites - capa" checks added from a repo's apptest config) are then matched against the longest configured name that is a prefix of them, with the suffix substituted into any `{{suffix}}` placeholder in the trigger.

func IsReleaseBranch added in v0.2.0

func IsReleaseBranch(ref string) bool

IsReleaseBranch returns true if the branch was created to open a release PR, e.g. `main#release#patch` or `release-v1.2.x#release#v1.2.3`. Release PRs always require their checks, even if they only change ignored paths.

func OnlyIgnoredFiles

func OnlyIgnoredFiles(files, patterns []string) bool

OnlyIgnoredFiles returns true if there is at least one file and every file matches at least one of the patterns.

Patterns are relative to the repo root, a leading `./` is ignored. Patterns ending in `/**` match everything below that directory, any other pattern is matched against the full path using path.Match (so `README.md` only matches the root README and `*` doesn't cross directories).

Types

type Conf

type Conf struct {
	KnownTriggers KnownTriggers `json:"knownTriggers"`
	IgnoredPaths  []string      `json:"ignoredPaths"`
	Repos         Repos         `json:"repos"`
}

func LoadConfig

func LoadConfig() (*Conf, error)

type KnownTriggers

type KnownTriggers map[string]string

type Repo

type Repo struct {
	RequiredChecks []string `json:"requiredChecks"`
	// IgnoredPaths overrides the global IgnoredPaths for this repo when set.
	IgnoredPaths []string `json:"ignoredPaths"`
}

func GetRepoConfig

func GetRepoConfig(repo string) (*Repo, error)

type Repos

type Repos map[string]Repo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL