docs
docs copied to clipboard
Contexts available for jobs.<job_id>.defaults.run.shell
Code of Conduct
- [X] 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/using-workflows/workflow-syntax-for-github-actions
What part(s) of the article would you like to see updated?
The section jobs.<job_id>.defaults.run.shell says
This keyword can reference several contexts. For more information, see "Contexts."
But the page "Contexts" doesn't mention keyword "shell" at all.
Please update the page "Contexts" to include context(s) available for jobs.<job_id>.defaults.run.shell.
If no contexts are available (I tried matrix and runner, both failed) please document that at the page jobs.<job_id>.defaults.run.shell.
Additional information
No response
Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.
@phdru Thanks so much for opening an issue! I'll get this triaged for review ✨
And BTW, page jobs.<job_id>.steps[*].shell doesn't mentions any contexts at all. It should IMO.
To explain what I want: I need to calculate system-specific shell:
shell: ${{ matrix.os-name == 'w32' && 'cmd /C call {0}' || 'bash -el {0}' }}
or
shell: ${{ runner.os == 'Windows' && 'cmd /C call {0}' || 'bash -el {0}' }}
Neither work so I want to know what contexts are available.
Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert :eyes:
Hi @phdru 👋🏻
The table on Context availability shows the field where a context is available. The context will also be available for any subfields of that field.
In this case, jobs.<job_id>.defaults.run and all subfields, including shell, can access the following contexts: github, needs, strategy, matrix, env, vars, inputs.
Ok, thank you for explanation!