Clarify vars context availability in composite actions
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github-actions, typescript
- Domain
- documentation
Research direction
Read the contexts reference and the composite actions article linked in the issue, then check how those pages are organized in the docs repository. Clarify that values a composite action needs, including values from vars, should be passed through inputs; use the examples in the issue to verify the guidance is consistent across both pages.
Written by the indexing model from the issue text.
Description
Code of Conduct
- I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/actions/reference/workflows-and-actions/contexts
https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-composite-action
What part(s) of the article would you like to see updated?
The documentation is unclear about whether the vars context is available inside composite actions.
The contexts reference lists vars as an available context, which can reasonably lead users to assume that this works inside a composite action:
runs:
using: composite
steps:
- shell: bash
run: echo "${{ vars.AWS_REGION }}"
However, the Composite Actions ADR states:
"Composite actions should leverage inputs to get values they need, they will not have full access to the context objects."
There is also an implementation detail documented by a runner collaborator in actions/runner#4311: variables are filtered based on references made directly in the calling job, so a vars reference used only inside a composite action may not be available to the runner.
Could the composite actions documentation explicitly clarify that values required by a composite action should be passed through inputs, including values originating from vars?
For example:
- uses: ./my-action
with:
region: ${{ vars.AWS_REGION }}
and then inside the composite action:
${{ inputs.region }}
This would make the relationship between the general contexts documentation and the more limited context availability of composite actions clearer.
Thanks
Additional information
No response
- Dominant language
- TypeScript
- Stars
- 21k
- Forks
- 69k
- Avg merge
- 8h 37m
- Merged PRs (30d)
- 117
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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.
More from github/docs
-
builder persona triage
Difficulty 1/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
content driver persona triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
github/docs#46222 · 1 comment ·
Maintainers usually reply within 1 day
-
builder persona content
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
github/docs#46190 · 2 comments ·
Maintainers usually reply within 1 day
-
Add user-level custom agent configurationPossibly taken @ashis-baral claimed this 7 days ago. Openbuilder persona content copilot
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
Similar issues
-
Add: YRF Music NepalOpenstreams:add
Difficulty 1/5 Under an hour Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
walletbeat/walletbeat#1558 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
hawk-digital-environments/HAWKI#438 ·
Maintainers usually reply within 1 day
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
GiganticMinecraft/seichi-portal-frontend#1165 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day