This composite action, based on actions/download-artifact
and
extracting the artifact's content from a tarball, will preserve file attributes like file permissions. This
essential capability is not implemented by GitHub until now (requested on 05.12.2019)
and still delayed and/or refused? to be implemented in the future. According to GitHub, the internal API doesn't allow
the implementation of such a feature, but this actions is demonstrating a working solution.
📤 See pyTooling/upload-artifact for the matching upload action.
jobs:
MyJob:
steps:
- name: 📥 Download artifact
uses: pyTooling/download-artifact@v4
with:
name: binary
- name: 📥 Download artifact
uses: pyTooling/download-artifact@dev
with:
name: documentation
path: public
- name: 📥 Download artifact
uses: pyTooling/download-artifact@dev
with:
pattern: unittest-*
path: reports
Parameter | Required | Default | Description |
---|---|---|---|
name |
no | '' |
Name of the artifact to download. If unspecified, all artifacts for the run are downloaded. |
path |
no | $GITHUB_WORKSPACE |
Destination path. Supports basic tilde expansion. |
pattern |
no | A glob pattern to the artifacts that should be downloaded. Ignored if name is specified. |
|
merge-multiple |
no | false |
When multiple artifacts are matched, this changes the behavior of the destination directories. If true, the downloaded artifacts will be in the same directory specified by path. If false, the downloaded artifacts will be extracted into individual named directories within the specified path. |
github-token |
no | The GitHub token used to authenticate with the GitHub API. This is required when downloading artifacts from a different repository or from a different workflow run. If unspecified, the action will download artifacts from the current repo and the current workflow run. |
|
repository |
no | ${{ github.repository }} |
The repository owner and the repository name joined together by "/". If github-token is specified, this is the repository that artifacts will be downloaded from. |
run-id |
no | ${{ github.run_id }} |
The id of the workflow run where the desired download artifact was uploaded from. If github-token is specified, this is the run that artifacts will be downloaded from. |
tarball-name |
no | 1 | |
investigate |
no | false |
If enabled, show the downloaded artifact's directory content as a tree. |
Parameter | Description |
---|---|
download-path |
Absolute path where the artifact(s) were downloaded. |
- Preserve file permissions
The artifact's content is collected in a tarball, which allows preserving file attributes like file permissions. - Don't remove common prefix from files
actions/upload-artifact
removes the common prefix from all files before storing in an artifact. This is not a well-defined behavior. Slightly changing the list of collected files might drastically change the directory structure of the artifact.
This action defines a root directory from where the content of the tarball is constructed. This is independent of the list of provided file patterns.
- Accepts artifacts uploaded from
actions/upload-artifact
(legacy artifacts) andpyTooling/upload-artifacts
.
- Patrick Lehmann (Maintainer)
- Sven Köhler
- and more...
This action was inspired by and is based on:
- actions/upload-artifact#38 - upload-artifact does not retain artifact permissions (08. Sep. 2024)
- Gist: rcdailey/download-tar-action.yml
This GitHub Composite Action (source code) licensed under The MIT License.
SPDX-License-Identifier: MIT
Footnotes
-
'__pyTooling_upload_artifact__.tar'
↩