Skip to main content

require-job-name

Rule catalog ID: R007

Targeted pattern scopeโ€‹

GitHub Actions workflow YAML files that declare jobs.

What this rule reportsโ€‹

This rule reports jobs that omit name or set name to a non-string or empty value.

Why this rule existsโ€‹

Job names appear in workflow graphs and logs. Requiring them makes complex workflows easier to navigate, especially when job IDs are terse.

โŒ Incorrectโ€‹

jobs:
build:
runs-on: ubuntu-latest

โœ… Correctโ€‹

jobs:
build:
name: Build
runs-on: ubuntu-latest

Behavior and migration notesโ€‹

This rule provides a suggestion that uses the job ID as a fallback display name when name is missing or blank. That is useful for quick cleanup, but you should still review the suggestion and replace it with a more descriptive label when the job does more than the raw ID implies.

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-job-name": "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โ€‹