Trigger Events
Event Overview
An Event is the driving force that starts a pipeline. When a specific action occurs in the repository, the system generates a corresponding event and triggers the Workflow that matches the on configuration.
Supported Event Types
| Event | Description | Typical Configuration |
|---|---|---|
push | Code push | on: push: branches: [main] |
pull_request | PR event | on: pull_request: branches: [main] |
pull_request_target | PR security event | on: pull_request_target: branches: [main] |
issue_comment | Issue comment | on: issue_comment: types: [created] |
pull_request_comment | PR comment | on: pull_request_comment: types: [created] |
workflow_dispatch | Manual trigger | on: workflow_dispatch: inputs: {...} |
workflow_call | Reusable call | on: workflow_call: inputs: {...} |
schedule | Scheduled trigger | on: schedule: - cron: '0 2 * * *' |
Important Difference:
pull_requestruns using the code from the PR source branch, whilepull_request_targetruns using the base branch code and has write access to the repository. It is recommended to usepull_request_targetin fork scenarios.
Multiple Event Combinations
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch: