require-merge-group-trigger
Rule catalog ID: R035
Targeted pattern scopeโ
GitHub Actions workflow YAML files that validate pull requests with the pull_request trigger.
What this rule reportsโ
This rule reports workflows that subscribe to pull_request but do not also declare a merge_group trigger.
Why this rule existsโ
GitHub documents that repositories using required GitHub Actions checks with merge queues must add the separate merge_group trigger. Otherwise, those required checks do not run when a pull request enters the queue, and the merge cannot complete.
โ Incorrectโ
on:
pull_request:
branches:
- main
โ Correctโ
on:
pull_request:
branches:
- main
merge_group:
types:
- checks_requested
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/require-merge-group-trigger": "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.