From d62fbd326fc2713d69f5d759d8bab824859ea57a Mon Sep 17 00:00:00 2001 From: Konrad Pabjan Date: Wed, 1 Dec 2021 14:27:47 -0500 Subject: [PATCH 1/2] Update README.md --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 95b85263..ec3bf5a6 100644 --- a/README.md +++ b/README.md @@ -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 }} +``` + ### Retention Period Artifacts are retained for 90 days by default. You can specify a shorter retention period using the `retention-days` input: From f49eb0150b8ac2af338a246c4df75840ec6b92f2 Mon Sep 17 00:00:00 2001 From: Konrad Pabjan Date: Wed, 1 Dec 2021 14:35:56 -0500 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ec3bf5a6..10e084dd 100644 --- a/README.md +++ b/README.md @@ -216,7 +216,7 @@ For environment variables created in other steps, make sure to use the `env` exp - uses: actions/upload-artifact@v2 with: name: artifact - path: ${{ env.artifactPath }} + path: ${{ env.artifactPath }} # this will resolve to testing/file.txt at runtime ``` ### Retention Period