Skip to content

Commit

Permalink
Document how to correctly use environment variables for path input (#274
Browse files Browse the repository at this point in the history
)

* Update README.md

* Update README.md
  • Loading branch information
konradpabjan committed Dec 6, 2021
1 parent a009a66 commit 5f375cc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -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:
Expand Down

0 comments on commit 5f375cc

Please sign in to comment.