Documentation
¶
Index ¶
- Constants
- func FilenameFor(w Workflow) string
- type AccessLevel
- type CallInput
- type CallInputType
- type CallOutput
- type CallSecrets
- type Concurrency
- type Container
- type ContainerCredentials
- type Defaults
- type DefaultsRun
- type Environment
- type Job
- type Matrix
- type OnBranches
- type OnCall
- type OnDispatch
- type OnDispatchInput
- type OnDispatchInputType
- type OnPaths
- type OnPullRequest
- type OnPush
- type OnSchedule
- type OnTags
- type OnWorkflowRun
- type Permissions
- type Secrets
- type Shell
- type Step
- type Strategy
- type StringOrInt
- func (x *StringOrInt) GetIntValue() int
- func (x *StringOrInt) GetStringValue() string
- func (x *StringOrInt) MarshalJSON() ([]byte, error)
- func (x *StringOrInt) TryGetIntValue() (int, error)
- func (x *StringOrInt) TryGetStringValue() (string, error)
- func (x *StringOrInt) UnmarshalJSON(data []byte) error
- type StringOrSlice
- type Workflow
- type WorkflowOn
Constants ¶
View Source
const (
DefaultPathToWorkflows = "./.github/workflows"
)
Variables ¶
This section is empty.
Functions ¶
func FilenameFor ¶
Types ¶
type AccessLevel ¶
type AccessLevel string
const ( AccessLevelWrite AccessLevel = "write" AccessLevelRead AccessLevel = "read" AccessLevelNone AccessLevel = "none" )
type CallInput ¶
type CallInput struct {
Description string `json:"description,omitempty,omitzero"`
Default string `json:"default,omitempty,omitzero"`
Required bool `json:"required,omitempty,omitzero"`
Type CallInputType `json:"type,omitempty,omitzero"`
}
type CallInputType ¶
type CallInputType string
const ( CallInputTypeString CallInputType = "string" CallInputTypeBoolean CallInputType = "boolean" CallInputTypeNumber CallInputType = "number" )
type CallOutput ¶
type CallSecrets ¶
type Concurrency ¶
type Concurrency struct {
Group string `json:"group,omitempty,omitzero"`
CancelInProgress bool `json:"cancel-in-progress,omitempty,omitzero"`
}
Concurrency https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency
type Container ¶
type Container struct {
Image string `json:"image,omitempty,omitzero"`
Env map[string]string `json:"env,omitempty,omitzero"`
Ports map[string]int `json:"ports,omitempty,omitzero"`
Volumes []string `json:"volumes,omitempty,omitzero"`
Credentials ContainerCredentials `json:"credentials,omitempty,omitzero"`
Options string `json:"options,omitempty,omitzero"`
}
type ContainerCredentials ¶
type Defaults ¶
type Defaults struct {
Run DefaultsRun `json:"run,omitempty,omitzero"`
}
type DefaultsRun ¶
type Environment ¶
type Job ¶
type Job struct {
Name string `json:"name,omitempty,omitzero"`
Permissions Permissions `json:"permissions,omitempty,omitzero"`
Needs StringOrSlice `json:"needs,omitempty,omitzero"`
If string `json:"if,omitempty,omitzero"`
RunsOn StringOrSlice `json:"runs-on,omitempty,omitzero"`
Environment Environment `json:"environment,omitempty,omitzero"`
Concurrency Concurrency `json:"concurrency,omitempty,omitzero"`
Outputs map[string]string `json:"outputs,omitempty,omitzero"`
Env map[string]string `json:"env,omitempty,omitzero"`
Defaults Defaults `json:"defaults,omitempty,omitzero"`
Steps []Step `json:"steps,omitempty,omitzero"`
TimeoutMinutes int `json:"timeout-minutes,omitempty,omitzero"`
ContinueOnError bool `json:"continue-on-error,omitempty,omitzero"`
Uses string `json:"uses,omitempty,omitzero"`
With map[string]string `json:"with,omitempty,omitzero"`
Secrets *Secrets `json:"secrets,omitempty,omitzero"`
Container Container `json:"container,omitempty,omitzero"`
Strategy Strategy `json:"strategy,omitempty,omitzero"`
}
type Matrix ¶
type Matrix struct {
Map map[string][]StringOrInt
Include []map[string]StringOrInt
Exclude []map[string]StringOrInt
}
func (*Matrix) MarshalJSON ¶
func (*Matrix) UnmarshalJSON ¶
type OnBranches ¶
type OnCall ¶
type OnCall struct {
Inputs map[string]CallInput `json:"inputs,omitempty,omitzero"`
Outputs map[string]CallOutput `json:"outputs,omitempty,omitzero"`
}
type OnDispatch ¶
type OnDispatch struct {
Inputs map[string]OnDispatchInput `json:"inputs,omitempty,omitzero"`
}
type OnDispatchInput ¶
type OnDispatchInput struct {
Description string `json:"description,omitempty,omitzero"`
Required bool `json:"required"`
Default string `json:"default,omitempty,omitzero"`
Type OnDispatchInputType `json:"type,omitempty,omitzero"`
Options []string `json:"options,omitempty,omitzero"`
}
type OnDispatchInputType ¶
type OnDispatchInputType string
const ( OnDispatchInputTypeString OnDispatchInputType = "string" OnDispatchInputTypeBoolean OnDispatchInputType = "boolean" OnDispatchInputTypeNumber OnDispatchInputType = "number" OnDispatchInputTypeEnvironment OnDispatchInputType = "environment" OnDispatchInputTypeChoice OnDispatchInputType = "choice" )
type OnPullRequest ¶
type OnPullRequest struct {
*OnPaths `json:",inline"`
*OnBranches `json:",inline"`
}
type OnPush ¶
type OnPush struct {
*OnPaths `json:",inline"`
*OnBranches `json:",inline"`
*OnTags `json:",inline"`
}
type OnSchedule ¶
type OnSchedule struct{}
type OnWorkflowRun ¶
type OnWorkflowRun struct {
Workflows []string `json:"workflows,omitempty,omitzero"`
Types []string `json:"types,omitempty,omitzero"`
*OnBranches `json:",inline"`
}
type Permissions ¶
type Permissions struct {
Actions AccessLevel `json:"actions,omitempty,omitzero"`
Attestations AccessLevel `json:"attestations,omitempty,omitzero"`
Checks AccessLevel `json:"checks,omitempty,omitzero"`
Contents AccessLevel `json:"contents,omitempty,omitzero"`
Deployments AccessLevel `json:"deployments,omitempty,omitzero"`
Discussions AccessLevel `json:"discussions,omitempty,omitzero"`
IDToken AccessLevel `json:"id-token,omitempty,omitzero"`
Issues AccessLevel `json:"issues,omitempty,omitzero"`
Models AccessLevel `json:"models,omitempty,omitzero"`
Packages AccessLevel `json:"packages,omitempty,omitzero"`
Pages AccessLevel `json:"pages,omitempty,omitzero"`
PullRequests AccessLevel `json:"pull-requests,omitempty,omitzero"`
SecurityEvents AccessLevel `json:"security-events,omitempty,omitzero"`
Statuses AccessLevel `json:"statuses,omitempty,omitzero"`
}
type Step ¶
type Step struct {
ID string `json:"id,omitempty,omitzero"`
Name string `json:"name,omitempty,omitzero"`
If string `json:"if,omitempty,omitzero"`
Uses string `json:"uses,omitempty,omitzero"`
Run string `json:"run,omitempty,omitzero"`
WorkingDirectory string `json:"working-directory,omitempty,omitzero"`
Shell Shell `json:"shell,omitempty,omitzero"`
With map[string]any `json:"with,omitempty,omitzero"`
Env map[string]string `json:"env,omitempty,omitzero"`
ContinueOnError bool `json:"continue-on-error,omitempty,omitzero"`
TimeoutMinutes int `json:"timeout-minutes,omitempty,omitzero"`
}
func TernaryExpressionStep ¶
TernaryExpressionStep is a better way to do if/else than with pure expressions, because of the pitfalls of truthy and falsy values
https://github.com/orgs/community/discussions/26738 Ternary Expressions suck in GitHub Actions, don't use them, instead use a bash expression more about all the pitfalls of trying to use || && here: https://7tonshark.com/posts/github-actions-ternary-operator/
the output name is "value", e.g. steps.my-step-id.outputs.value
type StringOrInt ¶
func (*StringOrInt) GetIntValue ¶
func (x *StringOrInt) GetIntValue() int
func (*StringOrInt) GetStringValue ¶
func (x *StringOrInt) GetStringValue() string
func (*StringOrInt) MarshalJSON ¶
func (x *StringOrInt) MarshalJSON() ([]byte, error)
func (*StringOrInt) TryGetIntValue ¶
func (x *StringOrInt) TryGetIntValue() (int, error)
func (*StringOrInt) TryGetStringValue ¶
func (x *StringOrInt) TryGetStringValue() (string, error)
func (*StringOrInt) UnmarshalJSON ¶
func (x *StringOrInt) UnmarshalJSON(data []byte) error
type StringOrSlice ¶ added in v0.6.0
type StringOrSlice []string
func (StringOrSlice) MarshalJSON ¶ added in v0.6.0
func (j StringOrSlice) MarshalJSON() ([]byte, error)
func (*StringOrSlice) UnmarshalJSON ¶ added in v0.6.0
func (j *StringOrSlice) UnmarshalJSON(data []byte) error
type Workflow ¶
type Workflow struct {
Name string `json:"name"`
RunName string `json:"run-name,omitempty,omitzero"`
On WorkflowOn `json:"on"`
Concurrency Concurrency `json:"concurrency,omitempty,omitzero"`
Defaults Defaults `json:"defaults,omitempty,omitzero"`
Env map[string]string `json:"env,omitempty,omitzero"`
Permissions Permissions `json:"permissions,omitempty,omitzero"`
Jobs map[string]Job `json:"jobs"`
// contains filtered or unexported fields
}
func (*Workflow) GetFilename ¶ added in v0.2.0
func (*Workflow) GetRelativePathAndFilename ¶ added in v0.2.0
func (*Workflow) SetFilename ¶ added in v0.3.0
type WorkflowOn ¶
type WorkflowOn struct {
Call *OnCall `json:"workflow_call,omitempty,omitzero"`
Run *OnWorkflowRun `json:"workflow_run,omitempty,omitzero"`
Dispatch *OnDispatch `json:"workflow_dispatch,omitempty,omitzero"`
Schedule *OnSchedule `json:"schedule,omitempty,omitzero"`
PullRequest *OnPullRequest `json:"pull_request,omitempty"`
PullRequestTarget *OnPullRequest `json:"pull_request_target,omitempty,omitzero"`
Push *OnPush `json:"push,omitempty,omitzero"`
}
WorkflowOn https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on
Click to show internal directories.
Click to hide internal directories.