Quick answer
Every GitHub Actions workflow must define when it runs using the top-level 'on' key.
GitHub Actions Missing 'on'
Every GitHub Actions workflow must define when it runs using the top-level 'on' key. Without it, the workflow is invalid.
Common causes
- Removing or renaming the 'on' key by mistake.
- Using a typo (e.g. 'On' or 'trigger') instead of 'on'.
- Leaving the workflow stub empty.
How to fix
- Add 'on:' at the top level with at least one event (e.g. on: push, or on: pull_request).
- Use the CI Config Linter to validate the full workflow structure.
FAQ
- What events can I use in GitHub Actions 'on'?
- Common events: push, pull_request, workflow_dispatch, schedule, repository_dispatch. See GitHub docs for the full list.
Fix it now
Try in validator (prefill this example)