Skip to main content

prefer-action-yml

Rule catalog ID: R043

Targeted pattern scopeโ€‹

GitHub Action metadata files named action.yaml.

What this rule reportsโ€‹

Reports action metadata files that use action.yaml instead of action.yml.

Why this rule existsโ€‹

GitHub supports both extensions, but the metadata docs call out action.yml as the preferred filename.

โŒ Incorrectโ€‹

action.yaml

โœ… Correctโ€‹

action.yml

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/prefer-action-yml": "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.

Further readingโ€‹