Skip to main content

no-duplicate-composite-step-id

Rule catalog ID: R051

Targeted pattern scopeโ€‹

Composite action runs.steps[*].id declarations.

What this rule reportsโ€‹

Reports duplicate step IDs in composite actions.

Why this rule existsโ€‹

Duplicate step IDs create ambiguous references and break output wiring.

โŒ Incorrectโ€‹

runs:
using: composite
steps:
- id: setup
run: echo one
shell: bash
- id: setup
run: echo two
shell: bash

โœ… Correctโ€‹

runs:
using: composite
steps:
- id: setup
run: echo one
shell: bash
- id: finish
run: echo two
shell: bash

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/no-duplicate-composite-step-id": "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โ€‹