Documentation
¶
Index ¶
- Constants
- func WithDeadline(deadline time.Time) workflowOptsFn
- func WithGitRef(ref string) workflowOptsFn
- func WithInputs(inputs map[string]interface{}) workflowOptsFn
- func WithLoggingChannel(logChan chan (logMessage)) workflowOptsFn
- func WithMaxRetryPeriod(period time.Duration) workflowOptsFn
- func WithRepo(owner string, repo string) workflowOptsFn
- type LogChannel
- type WorkflowRun
Constants ¶
const ( Error logLevel = iota Warning Info Debug Trace )
Variables ¶
This section is empty.
Functions ¶
func WithDeadline ¶ added in v0.4.0
WithDeadline sets the deadline for the workflow run to start and complete.
func WithGitRef ¶
func WithGitRef(ref string) workflowOptsFn
WithGitRef sets the Git ref used when creating the dispatch event. This is the ref that the Actions platform will use for sourcing the workflow code.
func WithInputs ¶
func WithInputs(inputs map[string]interface{}) workflowOptsFn
WithInputs sets the inputs for the workflow dispatch.
func WithLoggingChannel ¶ added in v0.4.0
func WithLoggingChannel(logChan chan (logMessage)) workflowOptsFn
WithLoggingChannel allows you to pass in a Go channel that will receive events from long running operations. Events are sent asynchronously and will not block execution.
func WithMaxRetryPeriod ¶
WithMaxRetryPeriod sets the maximum time to wait for the workflow run to start and complete.
Types ¶
type LogChannel ¶ added in v0.4.0
type LogChannel chan (logMessage)
LogChannel is a channel that can be used to receive messages during long operations, such as waiting for a workflow to complete. It is used with the WithLogChannel functional option.
type WorkflowRun ¶
type WorkflowRun struct { // Reference to the workflow definition Workflow *github.Workflow // Reference to the workflow run WorkflowRun *github.WorkflowRun // An identifier that is used to tie the workflow dispatch event to the workflow run. CallerRunID string // The error that caused the workflow to either fail to start or fail during execution. Error error // contains filtered or unexported fields }
WorkflowRun is a struct representing a single run of a workflow.
func NewWorkflowRun ¶
func NewWorkflowRun(path string, optsFn ...workflowOptsFn) *WorkflowRun
func Run ¶
func Run(path string, optsFn ...workflowOptsFn) *WorkflowRun
Run executes a workflow by path and returns a WorkflowRun struct for the current execution. To use this properly, the workflow _must_ accept an input called 'caller_run_id', and have a job that will use that input in its name.
func (*WorkflowRun) Run ¶
func (r *WorkflowRun) Run() *WorkflowRun
Run executes a workflow with the configured properties, then finds the linked workflow run by matching the struct's `CallerRunID` property with job names. It then fills in the workflow run details in the struct for later reference.
func (*WorkflowRun) Wait ¶
func (r *WorkflowRun) Wait() *WorkflowRun
Wait pauses execution until the workflow completes, then populates the Error property of the struct if the workflow run failed.