Skip to content

Commit

Permalink
Bump upload-artifact to v4 (#82)
Browse files Browse the repository at this point in the history
* Update GitHub Artifact Actions to v4

* Update GitHub Artifact Actions to v4

* Added matrix mode test

* Added matrix mode test

* Added matrix mode test

* Update upload-artifact action to version 4 in action.yml

* revert working-directory

* clean up tests

* clean up tests

* Add metadata-* pattern for artifact download

* Update artifact naming convention to include job ID

* Improve artifact naming for uniqueness in each job run

* Add step to generate unique id for artifact name

* Add 'shell: bash' to the 'generate' action step

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Igor Rodionov <[email protected]>
  • Loading branch information
3 people authored Jul 23, 2024
1 parent 64c1c17 commit 55a05a7
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 8 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test-changes-exists-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ jobs:
actual: "${{ needs.test.outputs.result }}"

- name: Download Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: metadata
pattern: metadata-*
merge-multiple: true

- name: Display structure of downloaded files
id: metadata
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test-failed-plan-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ jobs:
actual: "${{ needs.test.outputs.result }}"

- name: Download Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: metadata
pattern: metadata-*
merge-multiple: true

- name: Display structure of downloaded files
id: metadata
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test-no-changes-drift-more.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ jobs:
time: '30s'

- name: Download Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: metadata
pattern: metadata-*
merge-multiple: true

- name: Display structure of downloaded files
id: metadata
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test-no-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ jobs:
actual: "${{ needs.test.outputs.result }}"

- name: Download Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: metadata
pattern: metadata-*
merge-multiple: true

- name: Display structure of downloaded files
id: metadata
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test-settings-action-disabled-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ jobs:
actual: "${{ needs.test.outputs.result }}"

- name: Download Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: metadata
pattern: metadata-*
merge-multiple: true

- name: Display structure of downloaded files
id: metadata
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test-settings-action-disabled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ jobs:
actual: "${{ needs.test.outputs.result }}"

- name: Download Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: metadata
pattern: metadata-*
merge-multiple: true

- name: Display structure of downloaded files
id: metadata
Expand Down
12 changes: 10 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,19 @@ runs:
echo "result=\"\"" >> $GITHUB_OUTPUT
fi
- name: Generate a unique id
id: generate
shell: bash
run: |
echo "rand=$(openssl rand -hex 5)" >> "$GITHUB_OUTPUT"
- name: Upload Artifacts
if: ${{ steps.atmos-github-actions-enabled.outputs.value == 'true' && inputs.drift-detection-mode-enabled == 'true' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: metadata
# The name of the artifact needs to be unique for every job run!
# This name is filtered in cloudposse/github-action-atmos-terraform-drift-detection by the "metadata-*" prefix
name: metadata-${{ github.run_id }}-${{ steps.generate.outputs.rand }}
path: metadata
retention-days: ${{ inputs.metadata-retention-days }}

Expand Down

0 comments on commit 55a05a7

Please sign in to comment.