From ca3a911a746144cd4ff7ed1646aefd42968a85d4 Mon Sep 17 00:00:00 2001 From: Andrew Kim <6799182+andrewakim@users.noreply.github.com> Date: Fri, 19 Jan 2024 13:16:41 -0800 Subject: [PATCH] Update storing-workflow-data-as-artifacts.md (#48679) Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> Co-authored-by: Joe Clark <31087804+jc-clark@users.noreply.github.com> Co-authored-by: jc-clark --- .../storing-workflow-data-as-artifacts.md | 16 ++++++++-------- .../actions/action-download-artifact.md | 2 +- data/reusables/actions/action-upload-artifact.md | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/content/actions/using-workflows/storing-workflow-data-as-artifacts.md b/content/actions/using-workflows/storing-workflow-data-as-artifacts.md index cb8a08c313..41646a06a3 100644 --- a/content/actions/using-workflows/storing-workflow-data-as-artifacts.md +++ b/content/actions/using-workflows/storing-workflow-data-as-artifacts.md @@ -180,15 +180,15 @@ Jobs that are dependent on a previous job's artifacts must wait for the dependen Job 1 performs these steps: - Performs a math calculation and saves the result to a text file called `math-homework.txt`. -- Uses the `upload-artifact` action to upload the `math-homework.txt` file with the artifact name `homework`. +- Uses the `upload-artifact` action to upload the `math-homework.txt` file with the artifact name `homework_pre`. Job 2 uses the result in the previous job: -- Downloads the `homework` artifact uploaded in the previous job. By default, the `download-artifact` action downloads artifacts to the workspace directory that the step is executing in. You can use the `path` input parameter to specify a different download directory. +- Downloads the `homework_pre` artifact uploaded in the previous job. By default, the `download-artifact` action downloads artifacts to the workspace directory that the step is executing in. You can use the `path` input parameter to specify a different download directory. - Reads the value in the `math-homework.txt` file, performs a math calculation, and saves the result to `math-homework.txt` again, overwriting its contents. -- Uploads the `math-homework.txt` file. This upload overwrites the previously uploaded artifact because they share the same name. +- Uploads the `math-homework.txt` file. As artifacts are considered immutable in `v4`, the artifact is passed a different input, `homework_final`, as a name. Job 3 displays the result uploaded in the previous job: -- Downloads the `homework` artifact. +- Downloads the `homework_final` artifact from Job 2. - Prints the result of the math equation to the log. The full math operation performed in this workflow example is `(3 + 7) x 9 = 90`. @@ -209,7 +209,7 @@ jobs: - name: Upload math result for job 1 uses: {% data reusables.actions.action-upload-artifact %} with: - name: homework + name: homework_pre path: math-homework.txt job_2: @@ -220,7 +220,7 @@ jobs: - name: Download math result for job 1 uses: {% data reusables.actions.action-download-artifact %} with: - name: homework + name: homework_pre - shell: bash run: | value=`cat math-homework.txt` @@ -228,7 +228,7 @@ jobs: - name: Upload math result for job 2 uses: {% data reusables.actions.action-upload-artifact %} with: - name: homework + name: homework_final path: math-homework.txt job_3: @@ -239,7 +239,7 @@ jobs: - name: Download math result for job 2 uses: {% data reusables.actions.action-download-artifact %} with: - name: homework + name: homework_final - name: Print the final result shell: bash run: | diff --git a/data/reusables/actions/action-download-artifact.md b/data/reusables/actions/action-download-artifact.md index 11694395b5..5361ac71ad 100644 --- a/data/reusables/actions/action-download-artifact.md +++ b/data/reusables/actions/action-download-artifact.md @@ -1 +1 @@ -actions/download-artifact@v3 +actions/download-artifact@v4 diff --git a/data/reusables/actions/action-upload-artifact.md b/data/reusables/actions/action-upload-artifact.md index 248c970f06..8376b96609 100644 --- a/data/reusables/actions/action-upload-artifact.md +++ b/data/reusables/actions/action-upload-artifact.md @@ -1 +1 @@ -actions/upload-artifact@v3 +actions/upload-artifact@v4