Skip to content
Latchkey

GitHub Actions "No event triggers defined in 'on'" in CI

A workflow must list at least one event under on. When on is empty, null, or its events failed to parse, the validator reports no triggers are defined.

What this error means

The run fails with "Invalid workflow file" and "No event triggers defined in 'on'". The workflow never starts on push or pull_request.

GitHub Actions
Invalid workflow file: .github/workflows/ci.yml
(Line: 3, Col: 1): No event triggers defined in 'on'

Common causes

The on key is empty or null

Writing on: with nothing after it leaves the trigger list empty.

on was quoted away by YAML

Unquoted on: can be read as the boolean true in some YAML loaders, so the events go missing. Quoting "on": avoids this.

How to fix it

List concrete events under on

  1. Add at least one event such as push or pull_request.
  2. Quote the key as "on": if your tooling coerces it to a boolean.
  3. Re-run by pushing or opening a PR.
.github/workflows/ci.yml
"on":
  push:
    branches: [main]
  pull_request:

Use the list form for simple triggers

For multiple events without filters, a flow sequence is concise and unambiguous.

.github/workflows/ci.yml
on: [push, pull_request]

How to prevent it

  • Always define at least one event under on.
  • Quote "on" when YAML boolean coercion is a risk.
  • Validate the workflow before pushing.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →