Skip to content

Commit 6650f90

Browse files
authored
repo sync
2 parents c1c8570 + 6903560 commit 6650f90

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

content/actions/reference/environment-variables.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ versions:
2222

2323
To set custom environment variables, you need to specify the variables in the workflow file. You can define environment variables for a step, job, or entire workflow using the [`jobs.<job_id>.steps[*].env`](/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsenv), [`jobs.<job_id>.env`](/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idenv), and [`env`](/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#env) keywords. For more information, see "[Workflow syntax for {% data variables.product.prodname_dotcom %}](/articles/workflow-syntax-for-github-actions/#jobsjob_idstepsenv)."
2424

25+
{% raw %}
2526
```yaml
2627
jobs:
2728
weekday_job:
@@ -30,13 +31,14 @@ jobs:
3031
DAY_OF_WEEK: Mon
3132
steps:
3233
- name: "Hello world when it's Monday"
33-
if: env.DAY_OF_WEEK == 'Mon'
34+
if: ${{ env.DAY_OF_WEEK == 'Mon' }}
3435
run: echo "Hello $FIRST_NAME $middle_name $Last_Name, today is Monday!"
3536
env:
3637
FIRST_NAME: Mona
3738
middle_name: The
3839
Last_Name: Octocat
3940
```
41+
{% endraw %}
4042
4143
To use the value of an environment variable in a workflow file, you should use the [`env` context](/actions/reference/context-and-expression-syntax-for-github-actions#env-context). If you want to use the value of an environment variable inside a runner, you can use the runner operating system's normal method for reading environment variables.
4244

0 commit comments

Comments
 (0)