What events can trigger a workflow?
BeginnerConceptGitHub Actions
Answer
Common ones: push, pull_request, workflow_dispatch (manual, with inputs), schedule (cron, UTC), release, workflow_call (reusable workflow), workflow_run (after another workflow), repository_dispatch (API webhook), merge_group, and pull_request_target. You can filter by branches, tags and paths.
on:
push:
branches: [main]
tags: ['v*']
schedule:
- cron: '0 3 * * 1'
workflow_dispatch:
inputs:
env: { type: choice, options: [staging, prod], default: staging }
More on GitHub Actions
What are workflows, jobs, steps and actions in GitHub Actions?BeginnerWhat is the difference between `pull_request` and `pull_request_target`?AdvancedWhat is a runner, and how do GitHub-hosted and self-hosted runners differ?BeginnerHow do you pass data between steps and between jobs?IntermediateHow does a build matrix work?IntermediateWhat are reusable workflows and how do you call one?Intermediate