1
0
mirror of synced 2025-12-22 19:34:15 -05:00

Actions: env context cannot be used in job.<job_id>.if (#1803)

This commit is contained in:
Simran
2021-01-14 21:32:17 +01:00
committed by GitHub
parent a265add35e
commit ad5c362c63
2 changed files with 4 additions and 5 deletions

View File

@@ -111,15 +111,14 @@ The `github` context contains information about the workflow run and the event t
The `env` context contains environment variables that have been set in a workflow, job, or step. For more information about setting environment variables in your workflow, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#env)." The `env` context contains environment variables that have been set in a workflow, job, or step. For more information about setting environment variables in your workflow, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#env)."
The `env` context syntax allows you to use the value of an environment variable in your workflow file. If you want to use the value of an environment variable inside a runner, use the runner operating system's normal method for reading environment variables. The `env` context syntax allows you to use the value of an environment variable in your workflow file. You can use the `env` context in the value of any key in a **step** except for the `id` and `uses` keys. For more information on the step syntax, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idsteps)."
You can only use the `env` context in the value of the `with` and `name` keys, or in a step's `if` conditional. For more information on the step syntax, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idsteps)." If you want to use the value of an environment variable inside a runner, use the runner operating system's normal method for reading environment variables.
| Property name | Type | Description | | Property name | Type | Description |
|---------------|------|-------------| |---------------|------|-------------|
| `env` | `object` | This context changes for each step in a job. You can access this context from any step in a job. | | `env` | `object` | This context changes for each step in a job. You can access this context from any step in a job. |
| `env.<env name>` | `string` | The value of a specific environment variable. | | `env.<env_name>` | `string` | The value of a specific environment variable. |
#### `job` context #### `job` context

View File

@@ -187,7 +187,7 @@ For more information about cron syntax, see "[Events that trigger workflows](/ac
### `env` ### `env`
A `map` of environment variables that are available to all jobs and steps in the workflow. You can also set environment variables that are only available to a job or step. For more information, see [`jobs.<job_id>.env`](#jobsjob_idenv) and [`jobs.<job_id>.steps[*].env`](#jobsjob_idstepsenv). A `map` of environment variables that are available to the steps of all jobs in the workflow. You can also set environment variables that are only available to the steps of a single job or to a single step. For more information, see [`jobs.<job_id>.env`](#jobsjob_idenv) and [`jobs.<job_id>.steps[*].env`](#jobsjob_idstepsenv).
{% data reusables.repositories.actions-env-var-note %} {% data reusables.repositories.actions-env-var-note %}