Skip to content

Commit 5f375cc

Browse files
authored
Document how to correctly use environment variables for path input (#274)
* Update README.md * Update README.md
1 parent a009a66 commit 5f375cc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,20 @@ Environment variables along with context expressions can also be used for input.
205205
path: ${{ github.workspace }}/artifact/**/*
206206
```
207207

208+
For environment variables created in other steps, make sure to use the `env` expression syntax
209+
210+
```
211+
steps:
212+
- run: |
213+
mkdir testing
214+
echo "This is a file to upload" > testing/file.txt
215+
echo "artifactPath=testing/file.txt" >> $GITHUB_ENV
216+
- uses: actions/upload-artifact@v2
217+
with:
218+
name: artifact
219+
path: ${{ env.artifactPath }} # this will resolve to testing/file.txt at runtime
220+
```
221+
208222
### Retention Period
209223
210224
Artifacts are retained for 90 days by default. You can specify a shorter retention period using the `retention-days` input:

0 commit comments

Comments
 (0)