Skip to content

DuplicateStepId

Steps must have unique identifiers within a job.

Defined by DuplicateStepIdRule which supports workflows, actions in the "Default" ruleset along with SimilarStepId.

Description

Multiple steps having the same identifier makes them unreferenceable. The id: defined on a step becomes a key in the steps context. If multiple steps have the same identifier, only one of them will be accessible. Remove the one that is not needed, or rename it to be unique.

Relevant documentation:

Compliant example

Each step has a unique identifier or no identifier.

example.yml

on: push
jobs:
  example:
    runs-on: ubuntu-latest
    steps:
      - run: echo "Example"
        id: my-step-id
      - run: echo "Example"
      - run: echo "Example"
        id: my-other-step-id

Non-compliant example

Multiple steps have the same identifier.

This is very likely a copy-paste mistake.

example.yml

on: push
jobs:
  example:
    runs-on: ubuntu-latest
    steps:
      - run: echo "Example"
        id: my-step-id
      - run: echo "Example"
        id: my-step-id

  • Line 3: Job[example] has the my-step-id step identifier multiple times.