A workflow can run on repository activity, on a schedule, or when someone starts it manually or from outside GitHub. You list the triggers under the on key:
Repository events: push, pull_request, and release when a release is created or published. create and delete fire when a branch or tag is created or deleted.
Scheduled events: schedule runs on a cron expression, at most once every 5 minutes.
Manual and external events: workflow_dispatch is a manual trigger with optional inputs. repository_dispatch lets an outside system trigger a run through the API.
Other GitHub activity: check_run for check run activity, and deployment when someone creates a deployment.
By default, pull_request only runs when a pull request is opened, synchronized or reopened. There is no generic webhook event.
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
schedule:
- cron: '0 2 * * *' # Daily at 2 AM
workflow_dispatch:
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.