From ee2816b701eae0f7432f002bdb726b6f4db6dedf Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Wed, 9 Aug 2023 05:19:42 -0400 Subject: [PATCH] Clarify that environment variables should be treated as case sensitive (#26899) Co-authored-by: hubwriter --- .../using-a-proxy-server-with-self-hosted-runners.md | 4 +++- .../using-workflows/workflow-commands-for-github-actions.md | 6 ++++-- .../actions/actions-secrets-and-variables-naming.md | 2 +- .../actions/environment-variables-as-case-sensitive.md | 5 +++++ 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 data/reusables/actions/environment-variables-as-case-sensitive.md diff --git a/content/actions/hosting-your-own-runners/managing-self-hosted-runners/using-a-proxy-server-with-self-hosted-runners.md b/content/actions/hosting-your-own-runners/managing-self-hosted-runners/using-a-proxy-server-with-self-hosted-runners.md index 6bdfb88205..a72b9e727c 100644 --- a/content/actions/hosting-your-own-runners/managing-self-hosted-runners/using-a-proxy-server-with-self-hosted-runners.md +++ b/content/actions/hosting-your-own-runners/managing-self-hosted-runners/using-a-proxy-server-with-self-hosted-runners.md @@ -33,7 +33,9 @@ If you need a self-hosted runner to communicate via a proxy server, the self-hos The proxy environment variables are read when the self-hosted runner application starts, so you must set the environment variables before configuring or starting the self-hosted runner application. If your proxy configuration changes, you must restart the self-hosted runner application. -On Windows machines, the proxy environment variable names are not case-sensitive. On Linux and macOS machines, we recommend that you use all lowercase environment variables. If you have an environment variable in both lowercase and uppercase on Linux or macOS, for example `https_proxy` and `HTTPS_PROXY`, the self-hosted runner application uses the lowercase environment variable. +{% data reusables.actions.environment-variables-as-case-sensitive %} + +On Windows machines, the proxy environment variable names are case insensitive. On Linux and macOS machines, we recommend that you use all lowercase environment variables. If you have an environment variable in both lowercase and uppercase on Linux or macOS, for example `https_proxy` and `HTTPS_PROXY`, the self-hosted runner application uses the lowercase environment variable. {% data reusables.actions.self-hosted-runner-ports-protocols %} diff --git a/content/actions/using-workflows/workflow-commands-for-github-actions.md b/content/actions/using-workflows/workflow-commands-for-github-actions.md index 2b1a0001d7..10b3c8ba47 100644 --- a/content/actions/using-workflows/workflow-commands-for-github-actions.md +++ b/content/actions/using-workflows/workflow-commands-for-github-actions.md @@ -46,7 +46,7 @@ Write-Output "::workflow-command parameter1={data},parameter2={data}::{command v {% note %} -**Note:** Workflow command and parameter names are not case-sensitive. +**Note:** Workflow command and parameter names are case insensitive. {% endnote %} @@ -769,6 +769,8 @@ jobs: ## Setting an environment variable +{% data reusables.actions.environment-variables-as-case-sensitive %} + {% bash %} ```bash copy @@ -793,7 +795,7 @@ echo "{environment_variable_name}={value}" >> "$GITHUB_ENV" {% endpowershell %} -You can make an environment variable available to any subsequent steps in a workflow job by defining or updating the environment variable and writing this to the `GITHUB_ENV` environment file. 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. The names of environment variables are case-sensitive, and you can include punctuation. For more information, see "[AUTOTITLE](/actions/learn-github-actions/variables)." +You can make an environment variable available to any subsequent steps in a workflow job by defining or updating the environment variable and writing this to the `GITHUB_ENV` environment file. 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. {% data reusables.actions.environment-variables-are-fixed %} For more information about the default environment variables, see "[AUTOTITLE](/actions/learn-github-actions/environment-variables#default-environment-variables)." diff --git a/data/reusables/actions/actions-secrets-and-variables-naming.md b/data/reusables/actions/actions-secrets-and-variables-naming.md index 5e55e75e8e..f355e4abf7 100644 --- a/data/reusables/actions/actions-secrets-and-variables-naming.md +++ b/data/reusables/actions/actions-secrets-and-variables-naming.md @@ -1,5 +1,5 @@ - Names can only contain alphanumeric characters (`[a-z]`, `[A-Z]`, `[0-9]`) or underscores (`_`). Spaces are not allowed. - Names must not start with the `GITHUB_` prefix. - Names must not start with a number. -- Names are not case-sensitive. +- Names are case insensitive. - Names must be unique at the level they are created at. diff --git a/data/reusables/actions/environment-variables-as-case-sensitive.md b/data/reusables/actions/environment-variables-as-case-sensitive.md new file mode 100644 index 0000000000..bbfc6f2230 --- /dev/null +++ b/data/reusables/actions/environment-variables-as-case-sensitive.md @@ -0,0 +1,5 @@ +{% note %} + +**Note**: To avoid issues, it's good practice to treat environment variables as case sensitive, irrespective of the behavior of the operating system and shell you are using. + +{% endnote %}