require-github-actions-workflow-name
Require explicit top-level name in GitHub workflow files.
Targeted pattern scopeâ
This rule scans .github/workflows/*.{yml,yaml} and checks for a root-level name: key.
What this rule reportsâ
This rule reports workflow files that omit an explicit top-level name.
Why this rule existsâ
GitHub exposes workflow names in Actions UI and contexts. When name is omitted, the workflow context falls back to the workflow file path, which is less readable and less stable for reporting.
â Incorrectâ
on:
push:
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: npm test
â Correctâ
name: CI
on:
push:
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: npm test
ESLint flat config exampleâ
import repoPlugin from "eslint-plugin-repo";
export default [
repoPlugin.configs.github,
{
plugins: { "repo-compliance": repoPlugin },
rules: {
"repo-compliance/require-github-actions-workflow-name": "warn",
},
},
];
When not to use itâ
Disable this rule only if your team intentionally prefers file-path workflow naming and does not need explicit display names.
Rule catalog ID: R034