Code of Conduct
What article on docs.github.com is affected?
What part(s) of the article would you like to see updated?
I have found inconsistencies between the actions/reference/workflows-and-actions/contexts.md and the actions/reference/workflows-and-actions/reusable-workflows.md pages.
The reusable-workflows.md page defines contexts for jobs.<job_id>.secrets.<secret_id> and jobs.<job_id>.with.<input_id> like so:
## `jobs.<job_id>.with.<input_id>`
[...]
Allowed expression contexts: `github`, and `needs`.
## `jobs.<job_id>.secrets.<secret_id>`
[...]
Allowed expression contexts: `github`, `needs`, and `secrets`.
This seems to match observed behavior that the following using vars, using a reusable workflow that requires a secret, does not work: After testing in a different and cleaner environment, this actually does not match the observed behavior, as the following using vars, using a reusable workflow that requires a secret, does work:
jobs:
job:
uses: job.yml
secrets:
MY_SECRET: ${{ vars.MY_SECRET }}
Indeed, the contexts.md page defines these contexts like so:
| `jobs.<job_id>.secrets.<secrets_id>` | `github, needs, strategy, matrix, secrets, inputs, vars` | None |
| `jobs.<job_id>.with.<with_id>` | `github, needs, strategy, matrix, inputs, vars` | None |
So I would have expected vars to work in this context, but it does not.
Also while we are at it, note the workflow keys are not consistent: secrets_id vs secret_id, and with_id vs input_id.
Therefore I would suggest to:
- Rename the workflow keys in the
contexts.md page to match those in the reusable-workflows.md page,
- Update the "allowed expression contexts" in the
reusable-workflows.md page to match what is described in the contexts.md page.
Additional information
No response
Code of Conduct
What article on docs.github.com is affected?
What part(s) of the article would you like to see updated?
I have found inconsistencies between the
actions/reference/workflows-and-actions/contexts.mdand theactions/reference/workflows-and-actions/reusable-workflows.mdpages.The
reusable-workflows.mdpage defines contexts forjobs.<job_id>.secrets.<secret_id>andjobs.<job_id>.with.<input_id>like so:This seems to match observed behavior that the following usingAfter testing in a different and cleaner environment, this actually does not match the observed behavior, as the following usingvars, using a reusable workflow that requires a secret, does not work:vars, using a reusable workflow that requires a secret, does work:Indeed, the
contexts.mdpage defines these contexts like so:So I would have expectedvarsto work in this context, but it does not.Also while we are at it, note the workflow keys are not consistent:
secrets_idvssecret_id, andwith_idvsinput_id.Therefore I would suggest to:
contexts.mdpage to match those in thereusable-workflows.mdpage,reusable-workflows.mdpage to match what is described in thecontexts.mdpage.Additional information
No response