-
Notifications
You must be signed in to change notification settings - Fork 59.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description of vars usage is not acurate #33389
Comments
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. |
@withakay Thanks so much for opening an issue! I'll get this triaged for review ✨ |
I edited the description to fix some typos |
Hi @withakay 👋 Thank you for raising this concern 💛 `` I've followed your instructions to try to reproduce the issue. 1.) I created a new workflow and ran the workflow without adding the variable 2.) I added the variable
We will close the issue with no further actions. Thank you for understanding and being a valued part of our community. |
Thanks for taking the time to attempt to reproduce. I have created a repository to demonstrate here: If you could take another look that would be great |
Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert 👀 |
@withakay Thank you for taking the time to write up the steps to reproduce the issue. With your steps, I was able to reproduce your issue with the environment-level configuration variable. The environment-level configuration variable throws an undefined error in the following:
The environment-level configuration variable is passed through in the following:
The request to update the documentation to clarify that the environment-level configuration variable is not available until the target environment is declared makes sense to me. You, or anyone else, are free to open a pull request to make these changes. |
There are two different articles which mention the use of configuration variables at the environment level by the
|
A note is added to clarify when the configuration variables at the environment level are automatically available.
Added correct format to new note.
Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/actions/learn-github-actions/contexts#example-usage-of-the-vars-context
What part(s) of the article would you like to see updated?
To article states "This example workflow shows how configuration variables set at the repository, environment, or organization levels are automatically available using the vars context."
This is not acurate. In the below example where
vars.RUNNER
is variables defined in the environementdev
(that is to say not at the repository or organisation level) thenvars.RUNNER
will not be evaluated and you can expect an error like:Error when evaluating 'runs-on' for job 'test-job'. .github/workflows/test-job.yaml (Line: 26, Col: 14): Unexpected value ''
It seems to me either the article is incorrect or there is a bug in the github actions engine as the described behaviour is not acurate.
Additional information
To reproduce
RUNNER
with a value ofubuntu-latest
The text was updated successfully, but these errors were encountered: