Skip to content

on

on(input: WithMeta<OnInput>): OnModel

Create a trigger configuration model for the on: section of a workflow. Plain-object values for typed trigger fields (push, pullRequest, workflowDispatch, workflowCall, schedule entries) are automatically wrapped with their respective factory functions.

Parameter Type Description

input

WithMeta<OnInput>

Trigger event definitions and optional model metadata.

OnModel

An OnModel for use in a WorkflowInput.

on({
push: { branches: ["main"] },
pullRequest: { branches: ["main"] },
workflowDispatch: true,
})