From 85117bb5fe9a780c594236d3296750147eef7025 Mon Sep 17 00:00:00 2001 From: David Beitey Date: Mon, 23 Aug 2021 01:36:31 +0000 Subject: [PATCH] Clarify nature of GITHUB_ENV/GITHUB_PATH variables This adds a note and clarification around the explicit nature of using $GITHUB_ENV but the implicit, automatic application of $GITHUB_PATH. When reading the existing documentation, I was under the impression that these would both be applied in the same way, but the former requires explicit referencing in expression syntax whereas the latter is introduced in the shell environment automatically. --- .../reference/workflow-commands-for-github-actions.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/content/actions/reference/workflow-commands-for-github-actions.md b/content/actions/reference/workflow-commands-for-github-actions.md index fe749805fc3e..cee77f8df713 100644 --- a/content/actions/reference/workflow-commands-for-github-actions.md +++ b/content/actions/reference/workflow-commands-for-github-actions.md @@ -268,6 +268,12 @@ steps: 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 %} @@ -311,7 +317,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