salt/.github/actions/download-artifact/action.yml
2024-04-03 16:49:50 +01:00

42 lines
1.3 KiB
YAML

# This actions was inspired by https://github.com/alehechka/download-tartifact
---
name: Download Tar Artifact
description: >
Download and extract a tar artifact that was previously uploaded in the
workflow by the upload-tartifact action
inputs:
name:
description: Artifact name
required: false
path:
description: Destination path
required: false
archive-name:
description: >
By default `inputs.name`(last resort, `archive`) is what's used to name the archive.
This parameter allows a customizing that archive name. This will allow uploading multiple
archives under the same 'name', like the underlying official action does
without overriding the existing archives.
required: false
runs:
using: composite
steps:
- uses: actions/download-artifact@v3
# This needs to be actions/download-artifact@v3 because we upload multiple artifacts
# under the same name something that actions/upload-artifact@v4 does not do.
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
- shell: bash
working-directory: ${{ inputs.path }}
run: |
tar -xvf ${{ inputs.archive-name || inputs.name || 'archive' }}.tar.gz
- shell: bash
working-directory: ${{ inputs.path }}
run: |
rm -f ${{ inputs.archive-name || inputs.name || 'archive' }}.tar.gz