Documentation
¶
Index ¶
- Constants
- func Sync(path string, a Action) (changed bool, err error)
- func SyncWorkflow(path string, w Workflow) (changed bool, err error)
- func WithCheckoutFetchDepth(depth string) func(*WorkflowStep)
- func WithCheckoutFetchTags(v string) func(*WorkflowStep)
- type Action
- type Branding
- type Input
- type Job
- type KeyValue
- type On
- type Output
- type PullRequest
- type Push
- type Schedule
- type Step
- type Workflow
- type WorkflowDispatch
- type WorkflowStep
Constants ¶
const ( DefaultCheckout = "actions/checkout@v5" DefaultSetupGo = "actions/setup-go@v6" DefaultRunsOn = "ubuntu-latest" DefaultGoVersionFile = "go.mod" )
Optimal defaults - single place to bump Node24 actions.
const HeaderGeneratedAction = `` /* 151-byte string literal not displayed */
const HeaderGeneratedWorkflow = `` /* 160-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func Sync ¶ added in v0.1.0
Sync writes a's YAML to path when it differs from what is already there.
func SyncWorkflow ¶ added in v0.1.0
SyncWorkflow writes w's YAML to path when it differs.
func WithCheckoutFetchDepth ¶ added in v0.1.0
func WithCheckoutFetchDepth(depth string) func(*WorkflowStep)
WithCheckoutFetchDepth overrides fetch-depth.
func WithCheckoutFetchTags ¶ added in v0.1.0
func WithCheckoutFetchTags(v string) func(*WorkflowStep)
WithCheckoutFetchTags overrides fetch-tags.
Types ¶
type Action ¶ added in v0.1.0
type Job ¶ added in v0.1.0
type Job struct {
RunsOn string
If string
Permissions map[string]string
Env []KeyValue
Steps []WorkflowStep
}
Job is a single workflow job.
type On ¶ added in v0.1.0
type On struct {
Push *Push
PullRequest *PullRequest
Schedule []Schedule
WorkflowDispatch *WorkflowDispatch
}
On defines trigger events.
type PullRequest ¶ added in v0.1.0
type Workflow ¶ added in v0.1.0
type Workflow struct {
Name string
On On
Permissions map[string]string
Jobs map[string]Job
Header string
}
Workflow is a typed representation of a GitHub Actions workflow. It is generic and has no consumer domain knowledge.
func PresetTestWorkflow ¶ added in v0.1.0
func PresetTestWorkflow() Workflow
PresetTestWorkflow returns an optimal test workflow preset. Consumers can sync it in a test to avoid hardcoding test.yml.
type WorkflowDispatch ¶ added in v0.1.0
type WorkflowDispatch struct{}
type WorkflowStep ¶ added in v0.1.0
type WorkflowStep struct {
Name string
ID string
If string
Uses string
With []KeyValue
Run string
Shell string
Env []KeyValue
}
WorkflowStep is a step inside a job.
func CheckoutStep ¶ added in v0.1.0
func CheckoutStep(opts ...func(*WorkflowStep)) WorkflowStep
CheckoutStep returns a checkout step with optimal defaults. Use WithCheckoutFetchDepth / WithCheckoutFetchTags to override.
func CheckoutWithTags ¶ added in v0.1.0
func CheckoutWithTags() WorkflowStep
CheckoutWithTags returns checkout with fetch-depth 0 and fetch-tags true, optimal for release workflows.
func SetupGoStep ¶ added in v0.1.0
func SetupGoStep(opts ...func(*WorkflowStep)) WorkflowStep
SetupGoStep returns setup-go with optimal defaults (Node24, go-version-file).