Warn when someone uses ${{ steps.name.outputs.something }} instead of ${{ steps.id.outputs.something }}
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 1.4k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 24
Description
Describe the enhancement
GitHub workflows/actions objects have name and id fields, and sometimes one needs to use one and sometimes one needs to use the other. I lost quite a bit of time because I had given a step a name instead of an id.
Note that the basic documentation is here:
https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs
jobs.<job_id>.outputs
Code Snippet
One of the examples in the same document is wrong:
https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-7
environment:
name: production_environment
url: ${{ steps.step_name.outputs.url_output }}
Additional information
Expected behavior:
If there's a request for ${{ steps.step_name.outputs }} and there is no such id: step_name, check to see if there's a name: step_name and produce a warning suggesting that the workflow should be changed to assign that step_name to the id field.
Do not auto-correct for this botch (we don't need an IE-DOM-ism).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked GitHub Actions workflow-syntax documentation, especially jobs.<job_id>.outputs and example 7, then trace where the runner resolves steps..outputs. Add coverage for the name-without-id case and confirm the runner emits a warning without rewriting the workflow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, github-actions
- Domain
- ci-cd, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100