You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What part(s) of the article would you like to see updated?
The 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 a variable defined in the environment dev (that is to say not at the repository or organisation level) then vars.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 ''
Create an environment in the repository called 'dev'
Add a variable to the 'dev' environment called RUNNER with a value of ubuntu-latest
Run the Workflow and observe it failing in
It is crucial when reproducing that the RUNNER variable is added to the 'dev' environment. Adding it to a repository or organisation scoped variable will produce a false positive
The text was updated successfully, but these errors were encountered:
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?
The 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 a variable defined in the environmentdev
(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 accurate.
Additional information
Note this is a duplicate of the issue here which was closed due to a failure to reproduce.
I am still able to reproduce this issue and have created a repository to demonstrate this here: https://github.com/withakay/runner-env-var-repro
Perhaps the tester made a mistake when configuring the repository? 🤷♂️
To reproduce
I will outline the steps to reproduce manually, but I would advise forking the reproduction repository and then skipping to step 2
RUNNER
with a value ofubuntu-latest
It is crucial when reproducing that the RUNNER variable is added to the 'dev' environment. Adding it to a repository or organisation scoped variable will produce a false positive
The text was updated successfully, but these errors were encountered: