docs
docs copied to clipboard
Mention that `GITHUB_*` and `RUNNER_*` can't be set using `GITHUB_ENV` (but that `CI` can be)
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/learn-github-actions/environment-variables
What part(s) of the article would you like to see updated?
The default environment variables that GitHub sets are available to every step in a workflow.
We strongly recommend that actions use environment variables to access the filesystem rather than using hardcoded file paths. GitHub sets environment variables for actions to use in all runner environments.
My understanding is that one can't set GITHUB_*
/ RUNNER_*
variables using GITHUB_ENV
. However, CI
can be set using it.
There should be some documentation about this detail.
@aeisenberg mentioned the GITHUB_
part in:
https://github.com/github/codeql-action/issues/796#issuecomment-1018727859
And I'm pretty sure I've seen it somewhere, but I can't recall where, and I certainly can't find it.
The other place one might expect to see it is here: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
And it isn't mentioned there either.
Additional information
https://github.com/jsoref/actions-env-0/blob/513b30f1654f0525fc15959c67eb1618d3de7a9b/.github/workflows/env.ymlwhih https://github.com/jsoref/actions-env-0/runs/7753662690?check_suite_focus=true
2022-08-09T19:31:39.4209486Z ##[group]Run grep CI $GITHUB_ENV || echo CI=0 >> $GITHUB_ENV;
2022-08-09T19:31:39.4210046Z [36;1mgrep CI $GITHUB_ENV || echo CI=0 >> $GITHUB_ENV;[0m
2022-08-09T19:31:39.4210484Z [36;1mperl -pi -e 's/CI=.*/CI=test/' $GITHUB_ENV;[0m
2022-08-09T19:31:39.4210849Z [36;1mgrep CI $GITHUB_ENV[0m
2022-08-09T19:31:39.4273418Z shell: /usr/bin/bash -e {0}
2022-08-09T19:31:39.4273759Z ##[endgroup]
2022-08-09T19:31:39.4417914Z CI=test
2022-08-09T19:31:39.4461857Z ##[group]Run echo $CI
2022-08-09T19:31:39.4462243Z [36;1mecho $CI[0m
2022-08-09T19:31:39.4522487Z shell: /usr/bin/bash -e {0}
2022-08-09T19:31:39.4522841Z env:
2022-08-09T19:31:39.4523091Z CI: test
2022-08-09T19:31:39.4523368Z ##[endgroup]
2022-08-09T19:31:39.4866098Z test
:wave: @jsoref Thanks so much for opening an issue! I'll triage this for the team to take a look :eyes:
Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert :eyes:
This seems like a reasonable addition, although I'm not sure if being able to re-set CI
is an intentional (i.e. not a bug) behavior.
We should advise that it is not possible or advisable to re-set any of the default environment variables listed in https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables.
Also mentioning the same in https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable is good place too.
Adding a reusable to both locations would be the best approach. Feel free to open a PR 🚀
I don't suppose I could get you to investigate the CI
side? I'm happy to make the PR as is, but I really do file quite a few bugs, and I'm currently stuck on quite a few PRs and don't want to be seen as pestering (I really need someone to go through a whole actions org ... -- https://github.com/pulls?q=is%3Aopen+is%3Apr+author%3Ajsoref+archived%3Afalse+org%3Aactions)
@lucascosti ?
delet all my work plz i dont want
في جمعة، 20 يناير، 2566 BE في 8:35 م، كتب Josh Soref < @.***>:
@lucascosti https://github.com/lucascosti ?
— Reply to this email directly, view it on GitHub https://github.com/github/docs/issues/19626#issuecomment-1398636292, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUXWYV6DJA3NYVOEYDGVLOTWTK5ELANCNFSM56B7BKTQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Sorry, bot closed this prematurely.
I didn't get any response from engineering on the question of being able to set CI
variable, so at this point I'd assume that it's deliberate.
The content plan in https://github.com/github/docs/issues/19626#issuecomment-1223390491 is should be still applicable for anyone wanting to contribute 🙂
Sigh, lemme see if I can schedule this...
Wait, this was fixed. I fixed it! https://github.com/github/docs/pull/20069#issuecomment-1638268279