Skip to content

Commit eb0a1cc

Browse files
committed
clarify setting env vars in a step
Provide yaml with full context, instead of just two shell lines. Also, the cache demo was missing the yaml language hint.
1 parent d89d694 commit eb0a1cc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ You can use [workflow commands](https://docs.github.com/en/free-pro-team@latest/
6464
to set environment variables or add an element to `$PATH`. For example:
6565

6666
```yaml
67-
echo "CGO_ENABLED=0" >> $GITHUB_ENV
68-
echo "${HOME}/goroot/bin" >> $GITHUB_PATH
67+
steps:
68+
- name: Set env vars
69+
run: |
70+
echo "CGO_ENABLED=0" >> $GITHUB_ENV
71+
echo "${HOME}/goroot/bin" >> $GITHUB_PATH
6972
```
7073

7174
Note that these take effect for future steps in the job.
@@ -75,7 +78,7 @@ Note that these take effect for future steps in the job.
7578
Use [actions/cache](https://github.com/actions/cache). For example, to cache
7679
downloaded modules:
7780

78-
```
81+
```yaml
7982
- uses: actions/cache@v2
8083
with:
8184
path: ~/go/pkg/mod

0 commit comments

Comments
 (0)