Which YAML key do you use at the top level of a workflow file to specify what events trigger the workflow?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Think of 'on:' as the doorbell of your workflow — it tells GitHub Actions which events ring the bell and start the run.
Full explanation below image
Full Explanation
'on:' is the mandatory top-level key that defines event triggers in a GitHub Actions workflow. It accepts a single event name, a list of events, or a map of events to filter configurations. 'triggers:' and 'events:' are not valid GitHub Actions keys. 'when:' is used in other CI systems like GitLab. Without 'on:', the workflow file is syntactically incomplete and will not execute.