Skip to content

Triggers

Choose when CI runs. Connect your workflows to GitHub pushes and pull requests.

Trigger a workflow when a push reaches the specified branch.

ciTriggers: [
CITrigger.push(branch: 'main'),
],

Use CITrigger.pullRequest to run checks for pull requests.

ciTriggers: [
CITrigger.pullRequest(branch: 'main'),
],

A list can contain multiple triggers. For example, run the same checks for pull requests targeting main and for pushes to main.

final ci = await OpenCI.init(
workflowName: 'Flutter CI',
ciTriggers: [
CITrigger.push(branch: 'main'),
CITrigger.pullRequest(branch: 'main'),
],
);

Change branch names to match your repository. Use string literals for workflow names and branches.

  • Check that the workflow is in the repository's openci/ directory.
  • Check the configured branch and the GitHub event.
  • Check that the GitHub App has access to the repository.
  • Check the dashboard for a created build and available build machines.

See Write workflows in Dart for the workflow itself.