Triggers
Workflow trigger conditions — push, change_request, schedule, workflow_dispatch
triggers defines when a Workflow will be executed.
Supported Events
| Event | Description |
|---|---|
push | When code is pushed to a branch |
change_request | When a Change Request is created or updated |
schedule | Runs periodically according to a cron schedule |
workflow_dispatch | When triggered manually |
push
Runs the Workflow when code is pushed to a branch.
triggers:
push:
# main or develop branch, all branches starting with feature/
branches: [main, develop, "feature/*"]
# When a tag starting with v is pushed (e.g., v1.0.0, v2.1.3)
tags: ["v*"]
# Run only if files under src/ or tests/ have changed
paths: [src/**, tests/**]push Fields
| Field | Type | Description |
|---|---|---|
branches | list[string] | List of target branch patterns. Supports glob patterns (*, **) |
branches-ignore | list[string] | List of branch patterns to exclude. Cannot be used together with branches |
tags | list[string] | List of target tag patterns. Supports glob patterns |
tags-ignore | list[string] | List of tag patterns to exclude. Cannot be used together with tags |
paths | list[string] | Changed file path patterns. Supports ** recursive patterns and ! negation patterns |
paths-ignore | list[string] | File path patterns to ignore. Cannot be used together with paths |
Branch Pattern Examples
triggers:
push:
branches:
- main # Exactly the main branch
- "feature/*" # feature/login, feature/signup, etc.
- "release/**" # release/v1, release/v1/hotfix, etc. (recursive)Path Filter Examples
# Run only when files under src/ are changed
triggers:
push:
branches: [main]
paths:
- src/**
- package.json
# Ignore changes in docs/ (run on all other file changes)
triggers:
push:
branches: [main]
paths-ignore:
- docs/**
- "*.md"Branch/Tag Exclusion Examples
# Exclude branches starting with temp/ or wip/
triggers:
push:
branches-ignore:
- "temp/*"
- "wip/*"
# Exclude tags starting with v-beta, run on all other tags
triggers:
push:
tags-ignore:
- "v-beta*"The following field pairs cannot be used at the same time:
branchesandbranches-ignoretagsandtags-ignorepathsandpaths-ignore
change_request
Runs the Workflow when a Change Request is created or updated.
triggers:
change_request:
# Run only for CRs targeting the main branch
branches: [main]
# Ignore changes in docs/
paths-ignore: [docs/**]change_request Fields
| Field | Type | Description |
|---|---|---|
branches | list[string] | List of target (base) branch patterns |
branches-ignore | list[string] | List of branch patterns to exclude. Cannot be used together with branches |
paths | list[string] | Changed file path patterns |
paths-ignore | list[string] | File path patterns to ignore. Cannot be used together with paths |
tags and tags-ignore are not supported in change_request. Use push for tag-based triggers.
schedule
Runs the Workflow periodically according to a cron schedule.
triggers:
schedule:
# Target branch for execution (required)
branch: main
# Cron expressions (UTC-based)
cron:
- "0 0 * * *" # Every day at midnight (UTC)
- "0 12 * * 1-5" # Weekdays at noon (UTC)schedule Fields
| Field | Required | Type | Description |
|---|---|---|---|
branch | YES | string | Target branch for execution. Only a single branch can be specified |
cron | YES | list[string] | List of cron expressions (at least 1, UTC-based) |
Cron Expression Reference
┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-6, Sun=0)
│ │ │ │ │
* * * * *| Expression | Description |
|---|---|
0 0 * * * | Every day at midnight (UTC) |
0 */6 * * * | Every 6 hours |
30 9 * * 1-5 | Weekdays at 9:30 AM (UTC) |
0 0 1 * * | First day of every month at midnight |
workflow_dispatch
Triggers a Workflow manually. It can be triggered from the UI or via API.
triggers:
# Manual execution — just declare the key
workflow_dispatch:You can also apply a branch filter:
triggers:
# Manual execution with branch filter
workflow_dispatch:
branches: [main, develop]workflow_dispatch Fields
| Field | Type | Description |
|---|---|---|
branches | list[string] | List of branch patterns allowed for manual execution. Supports glob patterns |
workflow_dispatch does not support path filters (paths, paths-ignore).
Combining Multiple Triggers
You can set multiple triggers on a single Workflow. The Workflow runs if any one of them is satisfied.
triggers:
# 1. Run on push to main/develop
push:
branches: [main, develop]
paths: [src/**, package.json]
# 2. Run on CR targeting main
change_request:
branches: [main]
# 3. Scheduled run every day at midnight
schedule:
branch: main
cron: ["0 0 * * *"]
# 4. Allow manual execution
workflow_dispatch:Rules
The following field pairs cannot be used at the same time:
branches / branches-ignore
tags / tags-ignore
paths / paths-ignore
schedule.cron requires at least one entry.
schedule.branch is required and only a single branch can be specified.
workflow_dispatch does not support path filters.
change_request does not support tags / tags-ignore.
triggers must contain at least one event.