1
Fork 0
mirror of https://gitea.com/actions/upload-artifact.git synced 2024-11-09 18:25:58 +01:00

Document how to correctly use environment variables for path input (#274)

* Update README.md

* Update README.md
This commit is contained in:
Konrad Pabjan 2021-12-06 16:35:35 -05:00 committed by GitHub
parent a009a66585
commit 5f375cca4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -205,6 +205,20 @@ Environment variables along with context expressions can also be used for input.
path: ${{ github.workspace }}/artifact/**/*
```
For environment variables created in other steps, make sure to use the `env` expression syntax
```
steps:
- run: |
mkdir testing
echo "This is a file to upload" > testing/file.txt
echo "artifactPath=testing/file.txt" >> $GITHUB_ENV
- uses: actions/upload-artifact@v2
with:
name: artifact
path: ${{ env.artifactPath }} # this will resolve to testing/file.txt at runtime
```
### Retention Period
Artifacts are retained for 90 days by default. You can specify a shorter retention period using the `retention-days` input: