From f690661237a50bc7d4f60d4997132cc6e1e1d35c Mon Sep 17 00:00:00 2001 From: David Beitey Date: Sat, 25 Sep 2021 03:57:50 +1000 Subject: [PATCH] Clarify nature of GITHUB_ENV/GITHUB_PATH variables (#9236) --- .../workflow-commands-for-github-actions.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/content/actions/learn-github-actions/workflow-commands-for-github-actions.md b/content/actions/learn-github-actions/workflow-commands-for-github-actions.md index f6a6e9f43f..5c8554edf1 100644 --- a/content/actions/learn-github-actions/workflow-commands-for-github-actions.md +++ b/content/actions/learn-github-actions/workflow-commands-for-github-actions.md @@ -326,6 +326,12 @@ echo "{name}={value}" >> $GITHUB_ENV Creates or updates an environment variable for any steps running next in a job. The step that creates or updates the environment variable does not have access to the new value, but all subsequent steps in a job will have access. Environment variables are case-sensitive and you can include punctuation. +{% note %} + +**Note:** Environment variables must be explicitly referenced using the [`env` context](/actions/reference/context-and-expression-syntax-for-github-actions#env-context) in expression syntax or through use of the `$GITHUB_ENV` file directly; environment variables are not implicitly available in shell commands. + +{% endnote %} + ### Example {% raw %} @@ -371,7 +377,7 @@ steps: echo "{path}" >> $GITHUB_PATH ``` -Prepends a directory to the system `PATH` variable and makes it available to all subsequent actions in the current job; the currently running action cannot access the updated path variable. To see the currently defined paths for your job, you can use `echo "$PATH"` in a step or an action. +Prepends a directory to the system `PATH` variable and automatically makes it available to all subsequent actions in the current job; the currently running action cannot access the updated path variable. To see the currently defined paths for your job, you can use `echo "$PATH"` in a step or an action. ### Example