Skip to content

Commit a4d1c8b

Browse files
espipjSarah Edwards
andauthored
Improved the example of Setting an Environment Var (#2488)
Co-authored-by: Sarah Edwards <skedwards88@github.com>
1 parent 794b40f commit a4d1c8b

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

content/actions/reference/workflow-commands-for-github-actions.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,19 @@ Creates or updates an environment variable for any actions running next in a job
268268

269269
#### Example
270270

271-
```bash
272-
echo "action_state=yellow" >> $GITHUB_ENV
271+
{% raw %}
273272
```
274-
275-
Running `$action_state` in a future step will now return `yellow`
273+
steps:
274+
- name: Set the value
275+
id: step_one
276+
run: |
277+
echo "action_state=yellow" >> $GITHUB_ENV
278+
- name: Use the value
279+
id: step_two
280+
run: |
281+
echo "${{ env.action_state }}" # This will output 'yellow'
282+
```
283+
{% endraw %}
276284
277285
#### Multiline strings
278286

0 commit comments

Comments
 (0)