Triggers, defined under on:, indicate when a workflow starts: push, pull_request, schedule (cron), workflow_dispatch for a manual launch, etc. They can be restricted by branch or file path to avoid unnecessary runs.
Example
on:
pull_request:
branches: [main]