mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
58 lines
2.1 KiB
YAML
58 lines
2.1 KiB
YAML
# This actions was inspired by https://github.com/alehechka/upload-tartifact
|
|
---
|
|
name: Upload Tar Artifact
|
|
description: Compress files with tar prior to artifacting to keep file privileges.
|
|
|
|
inputs:
|
|
name:
|
|
description: Artifact name
|
|
default: artifact
|
|
required: false
|
|
path:
|
|
description: >
|
|
A file, directory or wildcard pattern that describes what to upload.
|
|
Note: The path provided will be maintained through tar, so after
|
|
download-tartifact, and subfolder structure will remain intact.
|
|
required: true
|
|
if-no-files-found:
|
|
description: >
|
|
The desired behavior if no files are found using the provided path.
|
|
Available Options:
|
|
warn: Output a warning but do not fail the action
|
|
error: Fail the action with an error message
|
|
ignore: Do not output any warnings or errors, the action does not fail
|
|
default: 'warn'
|
|
required: false
|
|
retention-days:
|
|
description: >
|
|
Duration after which artifact will expire in days. 0 means using default retention.
|
|
Minimum 1 day.
|
|
Maximum 90 days unless changed from the repository settings page.
|
|
required: false
|
|
archive-name:
|
|
description: >
|
|
By default `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:
|
|
- shell: bash
|
|
run: |
|
|
shopt -s globstar || echo "'globstar' not available"
|
|
tar -cavf ${{ inputs.archive-name || inputs.name || 'archive' }}.tar.gz ${{ inputs.path }}
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ inputs.name }}
|
|
path: ${{ inputs.archive-name || inputs.name || 'archive' }}.tar.gz
|
|
if-no-files-found: ${{ inputs.if-no-files-found }}
|
|
retention-days: ${{ inputs.retention-days }}
|
|
|
|
- shell: bash
|
|
run: |
|
|
rm -f ${{ inputs.archive-name || inputs.name || 'archive' }}.tar.gz
|