valid-trigger-events
Rule catalog ID: R018
Targeted pattern scopeโ
GitHub Actions workflow YAML files that declare trigger events under on.
What this rule reportsโ
This rule reports trigger event names that are not documented GitHub Actions workflow events.
Why this rule existsโ
Mistyped trigger names silently break workflow intent. Validating events early prevents workflows from never running, or from running at the wrong time.
โ Incorrectโ
on:
foo_bar:
โ Correctโ
on:
push:
branches:
- main
Additional examplesโ
For larger repositories, this rule is often enabled together with one of the published presets so violations are caught in pull requests before workflow changes are merged.
ESLint flat config exampleโ
import githubActions from "eslint-plugin-github-actions-2";
export default [
{
files: ["**/*.{yml,yaml}"],
plugins: {
"github-actions": githubActions,
},
rules: {
"github-actions/valid-trigger-events": "error",
},
},
];
When not to use itโ
You can disable this rule when its policy does not match your repository standards, or when equivalent enforcement is already handled by another policy tool.