StepIdNaming
¶
Step should have a lower-case kebab ID.
Defined by IdNamingRule
which supports workflows, actions in the "Default" ruleset along with WorkflowIdNaming
, JobIdNaming
.
Description¶
A unique identifier for the step. --
steps[*].id
documentation
The documentation doesn't define what's a valid ID, let alone a recommended one. Conventionally it's best to use lower-kebab-case naming for step names. This makes them consistent in style with the rest of the workflow syntax and workflow/job names.
Step IDs appear
- GitHub Expressions, as property dereferences of the
steps
context,
e.g.${{ steps.some-step }}
- in
if
conditions on other steps,
e.g.if: ${{ steps.some-step.outputs.some-output == 'something' }}
. - in
outputs
declarations of jobs,
e.g.some-output: ${{ steps.some-step.outputs.some-output }}
.
Compliant example¶
Not having an id is the best case, use name: to express what the step is to the reader.
example.yml
on: push jobs: example: runs-on: ubuntu-latest steps: - name: "Example" run: echo "Example"
Non-compliant example¶
Step has non-lower-kebab-case ID.
example.yml
on: push jobs: example: runs-on: ubuntu-latest steps: - id: example step_NAME run: echo "Example"
- Line 6: Step[example step_NAME] in Job[example] should have a lower-case kebab ID.