Skip to content

Commit 8eb82fd

Browse files
rosieyohannanclaudecursoragent
authored
Fix Vale errors in env-vars.adoc (#10516)
* don't error for links to support site * Fix Vale errors in env-vars.adoc Resolved the following Vale errors: - Lines 11,13,20,25,27,41-46,125,159,180,249,274-275,279,284,289-291: XrefTitleCase - Updated all xref link texts to title case - Lines 50,107: ImageTitles - Added missing image titles - Line 109: Avoid 'am' - Rewrote prose to avoid quoting step name containing 'am' - Line 206: Avoid 'were' - 'as if they were defined' → 'as if they are defined' Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent fc1fd73 commit 8eb82fd

1 file changed

Lines changed: 25 additions & 23 deletions

File tree

docs/guides/modules/security/pages/env-vars.adoc

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@
88

99
Use environment variables to set up various configuration options, and keep your set-up secure with secrets, private keys, and contexts. Environment variables in CircleCI are governed by an <<order-of-precedence,order of precedence>>, allowing control at each level in your configuration.
1010

11-
See the xref:set-environment-variable.adoc[Set an environment variable] page for guidance on the different ways to set an environment variable.
11+
See the xref:set-environment-variable.adoc[Set an Environment Variable] page for guidance on the different ways to set an environment variable.
1212

13-
If you have existing environment variables (or contexts) and you would like to rename your organization or repository, follow the xref:rename-organizations-and-repositories.adoc[Rename organizations and repositories] guide. The recommended steps ensure you do not lose access to environment variables or contexts in the process.
13+
If you have existing environment variables (or contexts) and you would like to rename your organization or repository, follow the xref:rename-organizations-and-repositories.adoc[Rename Organizations and Repositories] guide. The recommended steps ensure you do not lose access to environment variables or contexts in the process.
1414

1515
[#built-in-environment-variables]
1616
== Built-in environment variables
1717

1818
All projects have access to CircleCI's built-in environment variables. These environment variables are scoped at the job level, so they can be used with the `context` key in a job, but they do not exist at a pipeline level.
1919

20-
For a full list of built-in environment variables, see the xref:reference:ROOT:variables.adoc#built-in-environment-variables[Project values and variables] page.
20+
For a full list of built-in environment variables, see the xref:reference:ROOT:variables.adoc#built-in-environment-variables[Project Values and Variables] page.
2121

2222
[#private-keys-and-secrets]
2323
== Private keys and secrets
2424

25-
To add private keys or secrets as environment variables for use throughout your project, navigate to menu:Project Settings[Environment Variables] in the link:https://app.circleci.com/[CircleCI web app]. You can find step-by-step instructions of this process on the xref:set-environment-variable.adoc#set-an-environment-variable-in-a-project[Environment variables] page. The variable values are neither readable nor editable in the app after they are set. To change the value of an environment variable, delete the current variable, and add it again with the new value.
25+
To add private keys or secrets as environment variables for use throughout your project, navigate to menu:Project Settings[Environment Variables] in the link:https://app.circleci.com/[CircleCI web app]. You can find step-by-step instructions of this process on the xref:set-environment-variable.adoc#set-an-environment-variable-in-a-project[Environment Variables] page. The variable values are neither readable nor editable in the app after they are set. To change the value of an environment variable, delete the current variable, and add it again with the new value.
2626

27-
Private environment variables enable you to store secrets safely, even when your project is public. Refer to the xref:integration:oss.adoc[Building open source projects] page for associated security and settings information.
27+
Private environment variables enable you to store secrets safely, even when your project is public. Refer to the xref:integration:oss.adoc[Building Open Source Projects] page for associated security and settings information.
2828

2929
include::ROOT:partial$shared-sections/secrets-masking.adoc[]
3030

@@ -38,15 +38,16 @@ CircleCI uses Bash, which follows the POSIX naming convention for environment va
3838

3939
Environment variables are used according to a specific precedence order, as follows:
4040

41-
. Environment variables declared xref:set-environment-variable.adoc#set-an-environment-variable-in-a-shell-command[inside a shell command] in a `run` step, for example `FOO=bar make install`.
42-
. Environment variables declared with the `environment` key xref:set-environment-variable.adoc#set-an-environment-variable-in-a-step[for a `run` step].
43-
. Environment variables set with the `environment` key xref:set-environment-variable.adoc#set-an-environment-variable-in-a-job[for a job].
44-
. Special CircleCI environment variables defined in the xref:reference:ROOT:variables.adoc#built-in-environment-variables[CircleCI Built-in environment variables] document.
41+
. Environment variables declared xref:set-environment-variable.adoc#set-an-environment-variable-in-a-shell-command[Inside a Shell Command] in a `run` step, for example `FOO=bar make install`.
42+
. Environment variables declared with the `environment` key xref:set-environment-variable.adoc#set-an-environment-variable-in-a-step[For a `run` Step].
43+
. Environment variables set with the `environment` key xref:set-environment-variable.adoc#set-an-environment-variable-in-a-job[For a Job].
44+
. Special CircleCI environment variables defined in the xref:reference:ROOT:variables.adoc#built-in-environment-variables[CircleCI Built-in Environment Variables] document.
4545
. Context environment variables (assuming the user has access to the context). See the xref:contexts.adoc[Contexts] documentation for more information.
46-
. xref:set-environment-variable.adoc#set-an-environment-variable-in-a-project[Project-level environment variables] set on the *Project Settings* page in the web app.
46+
. xref:set-environment-variable.adoc#set-an-environment-variable-in-a-project[Project-Level Environment Variables] set on the *Project Settings* page in the web app.
4747

4848
Environment variables declared inside a shell command `run` step, for example `FOO=bar make install`, will override environment variables declared with the `environment` and `contexts` keys. Environment variables added on the *Contexts* page in the web app will take precedence over variables added on the *Project Settings* page.
4949

50+
.Environment variable order of precedence
5051
image::guides:ROOT:env-var-order.png[Environment variable order of precedence]
5152

5253
[#example-configuration-of-environment-variables]
@@ -104,9 +105,10 @@ The above `.circleci/config.yml` demonstrates the following:
104105
105106
When the above configuration runs, the output looks like the image below. Notice the environment variables stored in the project is masked, and displays as `+****+`:
106107

108+
.Environment variable interpolation example
107109
image::guides:ROOT:env-vars-example-ui.png[Environment variable interpolation example]
108110

109-
Notice there are two similar steps in the above image and configuration - "What branch am I on?" These steps illustrate two different methods to read environment variables.
111+
Notice there are two similar steps in the above image and configuration - both checking the current branch name. These steps illustrate two different methods to read environment variables.
110112

111113
In the example configuration above, two syntax variants are used: `+${VAR}+` and `$VAR`. Both syntax variants are supported. You can read more about shell parameter expansion in the link:https://www.gnu.org/software/bash/manual/bashref.html#Shell-Parameter-Expansion[Bash documentation].
112114

@@ -122,7 +124,7 @@ In the example below, `$ORGNAME` and `$REPONAME` will not be interpolated.
122124
working_directory: /go/src/github.com/$ORGNAME/$REPONAME
123125
----
124126

125-
NOTE: An exception to this interpolation rule is using project environment variables to pull xref:execution-managed:private-images.adoc[private images].
127+
NOTE: An exception to this interpolation rule is using project environment variables to pull xref:execution-managed:private-images.adoc[Private Images].
126128

127129
You can reuse pieces of configuration across your `.circleci/config.yml` file. By using the `parameters` declaration, you can pass values into reusable `commands`, `jobs`, and `executors`:
128130

@@ -156,7 +158,7 @@ workflows:
156158
repo_name: project2
157159
----
158160
159-
For more information, read the documentation on xref:reference:ROOT:reusing-config.adoc#using-the-parameters-declaration[using the parameters declaration].
161+
For more information, read the documentation on xref:reference:ROOT:reusing-config.adoc#using-the-parameters-declaration[Using the Parameters Declaration].
160162
161163
Another possible method to interpolate values into your configuration is to use a `run` step to export environment variables to `BASH_ENV`, as shown below.
162164
@@ -177,7 +179,7 @@ In every step, CircleCI uses `bash` to source `BASH_ENV`. This means that `BASH_
177179
[#environment-variable-substitution]
178180
=== Environment variable substitution
179181
180-
The CircleCI environment CLI offers a wrapper around the link:https://github.com/a8m/envsubst[`envsubst`] tool, available both locally as well as in all jobs running on CircleCI. `envsubst` is a command-line utility used to replace environment variables in text strings. You can also refer to the full xref:toolkit:environment-cli-usage-guide.adoc[Environment CLI usage guide].
182+
The CircleCI environment CLI offers a wrapper around the link:https://github.com/a8m/envsubst[`envsubst`] tool, available both locally as well as in all jobs running on CircleCI. `envsubst` is a command-line utility used to replace environment variables in text strings. You can also refer to the full xref:toolkit:environment-cli-usage-guide.adoc[Environment CLI Usage Guide].
181183
182184
CLI command:
183185
@@ -203,7 +205,7 @@ Within your repository create a file such as `template.json`, with value replace
203205
204206
`envsubst` can convert all types of environment variable strings, including those encased in curly braces (`{}`).
205207
206-
The config example below shows the corresponding environment variables as if they were defined directly within a step in the config. However, we strongly recommend creating the environment variables in the CircleCI app, either in xref:set-environment-variable.adoc#set-an-environment-variable-in-a-project[Project Settings] or as a xref:contexts.adoc[context].
208+
The config example below shows the corresponding environment variables as if they are defined directly within a step in the config. However, we strongly recommend creating the environment variables in the CircleCI app, either in xref:set-environment-variable.adoc#set-an-environment-variable-in-a-project[Project Settings] or as a xref:contexts.adoc[context].
207209
208210
[,yaml]
209211
----
@@ -246,7 +248,7 @@ Output:
246248
}
247249
----
248250
249-
For instructions on installing the CircleCI CLI locally, read the xref:toolkit:local-cli.adoc[Installing the CircleCI local CLI] guide.
251+
For instructions on installing the CircleCI CLI locally, read the xref:toolkit:local-cli.adoc[Installing the CircleCI Local CLI] guide.
250252
251253
[#alpine-linux]
252254
=== Alpine Linux
@@ -271,21 +273,21 @@ jobs:
271273
272274
Do not add secrets or keys inside the `.circleci/config.yml` file. The full text of `.circleci/config.yml` is visible to developers with access to your project on CircleCI. Store secrets or keys in the CircleCI web app under one of the following:
273275
274-
* In xref:set-environment-variable.adoc#set-an-environment-variable-in-a-project[Project settings].
275-
* In a xref:set-environment-variable.adoc#set-an-environment-variable-in-a-context[context].
276+
* In xref:set-environment-variable.adoc#set-an-environment-variable-in-a-project[Project Settings].
277+
* In a xref:set-environment-variable.adoc#set-an-environment-variable-in-a-context[Context].
276278
277279
For more information, see the xref:security.adoc#encryption[Encryption] section of the security page.
278280
279-
Running scripts within configuration may expose secret environment variables. See the xref:orchestrate:using-shell-scripts.adoc#shell-script-best-practices[Using shell scripts] page for best practices for secure scripts.
281+
Running scripts within configuration may expose secret environment variables. See the xref:orchestrate:using-shell-scripts.adoc#shell-script-best-practices[Using Shell Scripts] page for best practices for secure scripts.
280282
281283
[#contexts]
282284
== Contexts
283285
284-
You can further restrict access to environment variables using xref:contexts.adoc[contexts]. Contexts are set from the *Organization Settings* in the CircleCI web app.
286+
You can further restrict access to environment variables using xref:contexts.adoc[Contexts]. Contexts are set from the *Organization Settings* in the CircleCI web app.
285287
286288
[#see-also]
287289
== See also
288290
289-
* xref:security-recommendations.adoc[Security recommendations]
290-
* xref:set-environment-variable.adoc[Set an environment variable]
291-
* xref:inject-environment-variables-with-api.adoc[Inject variables using the CircleCI API]
291+
* xref:security-recommendations.adoc[Security Recommendations]
292+
* xref:set-environment-variable.adoc[Set an Environment Variable]
293+
* xref:inject-environment-variables-with-api.adoc[Inject Variables Using the CircleCI API]

0 commit comments

Comments
 (0)