Documentation
¶
Index ¶
Constants ¶
const LicenseDestination = "LICENSE"
LicenseDestination is the destination path for the licence file. Licences are not embedded swatches; they are fetched via gh at alter time.
Variables ¶
This section is empty.
Functions ¶
func Content ¶
Content returns the embedded bytes for the swatch identified by path. The path is relative to swatches/, e.g. ".github/workflows/tailor.yml".
func EvaluateTrigger ¶
EvaluateTrigger returns true when the path has no trigger condition or when the matching field on repo satisfies the condition. It returns false if repo is nil and a trigger exists, or if the field value does not match. The repo parameter must be a pointer to a struct with yaml-tagged fields.
Types ¶
type AlterationMode ¶
type AlterationMode string
AlterationMode controls how a swatch is applied to a project.
const ( Always AlterationMode = "always" FirstFit AlterationMode = "first-fit" Triggered AlterationMode = "triggered" Never AlterationMode = "never" )
type Category ¶
type Category string
Category classifies a swatch as either a community health file or a development tooling file.
type Swatch ¶
type Swatch struct {
Path string
DefaultAlteration AlterationMode
Category Category
}
Swatch describes a single template file with its path, default alteration mode, and category.
func HealthSwatches ¶
func HealthSwatches() []Swatch
HealthSwatches returns only the swatches categorised as health.
type TriggerCondition ¶
TriggerCondition maps a swatch path to a config field and the value that must match for the swatch to be deployed.
func LookupTrigger ¶
func LookupTrigger(path string) (TriggerCondition, bool)
LookupTrigger returns the trigger condition for the given swatch path and true if one exists, or a zero value and false otherwise.