mirror of
https://github.com/actions/download-artifact.git
synced 2026-09-09 04:41:32 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
484a0b528f | ||
|
|
3e5f45b2cf | ||
|
|
e6d03f6737 |
@@ -154,3 +154,169 @@ jobs:
|
|||||||
}
|
}
|
||||||
Write-Host "Successfully downloaded artifact without decompressing: $rawFile (size: $($fileInfo.Length) bytes)"
|
Write-Host "Successfully downloaded artifact without decompressing: $rawFile (size: $($fileInfo.Length) bytes)"
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|
||||||
|
# Regression test for artifact filename vs content-type mismatch
|
||||||
|
# When an archived artifact has a name with a file extension that doesn't
|
||||||
|
# match the blob type (e.g. "report.txt" but blob is zip), the server
|
||||||
|
# should append .zip to the content-disposition filename.
|
||||||
|
- name: Create and upload archived artifact with misleading extension
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p path/to/extension-test
|
||||||
|
echo '{"key": "value"}' > path/to/extension-test/data.json
|
||||||
|
- uses: actions/upload-artifact@v4 # V4 is important here to ensure we're supporting older versions correctly
|
||||||
|
with:
|
||||||
|
name: report.txt-${{ matrix.runs-on }}.json
|
||||||
|
path: path/to/extension-test/data.json
|
||||||
|
|
||||||
|
- name: Download misleading-extension artifact without decompressing
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
name: report.txt-${{ matrix.runs-on }}.json
|
||||||
|
path: ext-test/raw
|
||||||
|
skip-decompress: true
|
||||||
|
|
||||||
|
- name: Verify downloaded file has .zip extension appended
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
expected="ext-test/raw/report.txt-${{ matrix.runs-on }}.json.zip"
|
||||||
|
if [ -f "$expected" ]; then
|
||||||
|
echo "PASS: Downloaded file has .zip appended: $expected"
|
||||||
|
else
|
||||||
|
echo "FAIL: Expected $expected but got:"
|
||||||
|
ls -al ext-test/raw/
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Test uploading and downloading artifacts with CJK (Chinese, Japanese, Korean) characters
|
||||||
|
# Regression test: certain non-ASCII chars (e.g. U+571F 土) caused 400 errors from
|
||||||
|
# Azure Blob Storage due to encoding issues in the Content-Disposition / rscd parameter
|
||||||
|
- name: Create artifacts with CJK names
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p path/to/cjk-artifacts
|
||||||
|
# Chinese - 土 (U+571F) known to fail, 日 (U+65E5) known to work
|
||||||
|
echo "Content for 土" > "path/to/cjk-artifacts/file-土-${{ matrix.runs-on }}.txt"
|
||||||
|
echo "Content for 中文测试" > "path/to/cjk-artifacts/file-中文测试-${{ matrix.runs-on }}.txt"
|
||||||
|
# Japanese - katakana and kanji
|
||||||
|
echo "Content for テスト" > "path/to/cjk-artifacts/file-テスト-${{ matrix.runs-on }}.txt"
|
||||||
|
echo "Content for 東京タワー" > "path/to/cjk-artifacts/file-東京タワー-${{ matrix.runs-on }}.txt"
|
||||||
|
# Korean - Hangul
|
||||||
|
echo "Content for 테스트" > "path/to/cjk-artifacts/file-테스트-${{ matrix.runs-on }}.txt"
|
||||||
|
echo "Content for 서울시" > "path/to/cjk-artifacts/file-서울시-${{ matrix.runs-on }}.txt"
|
||||||
|
|
||||||
|
- name: Upload CJK artifact - Chinese 土
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
path: path/to/cjk-artifacts/file-土-${{ matrix.runs-on }}.txt
|
||||||
|
archive: false
|
||||||
|
|
||||||
|
- name: Upload CJK artifact - Chinese 中文测试
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
path: path/to/cjk-artifacts/file-中文测试-${{ matrix.runs-on }}.txt
|
||||||
|
archive: false
|
||||||
|
|
||||||
|
- name: Upload CJK artifact - Japanese テスト
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
path: path/to/cjk-artifacts/file-テスト-${{ matrix.runs-on }}.txt
|
||||||
|
archive: false
|
||||||
|
|
||||||
|
- name: Upload CJK artifact - Japanese 東京タワー
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
path: path/to/cjk-artifacts/file-東京タワー-${{ matrix.runs-on }}.txt
|
||||||
|
archive: false
|
||||||
|
|
||||||
|
- name: Upload CJK artifact - Korean 테스트
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
path: path/to/cjk-artifacts/file-테스트-${{ matrix.runs-on }}.txt
|
||||||
|
archive: false
|
||||||
|
|
||||||
|
- name: Upload CJK artifact - Korean 서울시
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
path: path/to/cjk-artifacts/file-서울시-${{ matrix.runs-on }}.txt
|
||||||
|
archive: false
|
||||||
|
|
||||||
|
- name: Download CJK artifact - Chinese 土
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
name: file-土-${{ matrix.runs-on }}.txt
|
||||||
|
path: cjk-download/土
|
||||||
|
|
||||||
|
- name: Download CJK artifact - Chinese 中文测试
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
name: file-中文测试-${{ matrix.runs-on }}.txt
|
||||||
|
path: cjk-download/中文测试
|
||||||
|
|
||||||
|
- name: Download CJK artifact - Japanese テスト
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
name: file-テスト-${{ matrix.runs-on }}.txt
|
||||||
|
path: cjk-download/テスト
|
||||||
|
|
||||||
|
- name: Download CJK artifact - Japanese 東京タワー
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
name: file-東京タワー-${{ matrix.runs-on }}.txt
|
||||||
|
path: cjk-download/東京タワー
|
||||||
|
|
||||||
|
- name: Download CJK artifact - Korean 테스트
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
name: file-테스트-${{ matrix.runs-on }}.txt
|
||||||
|
path: cjk-download/테스트
|
||||||
|
|
||||||
|
- name: Download CJK artifact - Korean 서울시
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
name: file-서울시-${{ matrix.runs-on }}.txt
|
||||||
|
path: cjk-download/서울시
|
||||||
|
|
||||||
|
- name: Verify CJK artifact downloads
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
fail=0
|
||||||
|
|
||||||
|
check_file() {
|
||||||
|
local file="$1"
|
||||||
|
local expected="$2"
|
||||||
|
if [ ! -f "$file" ]; then
|
||||||
|
echo "FAIL: Missing file: $file"
|
||||||
|
fail=1
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
actual=$(cat "$file")
|
||||||
|
if [ "$actual" != "$expected" ]; then
|
||||||
|
echo "FAIL: Content mismatch in $file"
|
||||||
|
echo " Expected: '$expected'"
|
||||||
|
echo " Got: '$actual'"
|
||||||
|
fail=1
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
echo "PASS: $file"
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "=== Chinese ==="
|
||||||
|
check_file "cjk-download/土/file-土-${{ matrix.runs-on }}.txt" "Content for 土"
|
||||||
|
check_file "cjk-download/中文测试/file-中文测试-${{ matrix.runs-on }}.txt" "Content for 中文测试"
|
||||||
|
|
||||||
|
echo "=== Japanese ==="
|
||||||
|
check_file "cjk-download/テスト/file-テスト-${{ matrix.runs-on }}.txt" "Content for テスト"
|
||||||
|
check_file "cjk-download/東京タワー/file-東京タワー-${{ matrix.runs-on }}.txt" "Content for 東京タワー"
|
||||||
|
|
||||||
|
echo "=== Korean ==="
|
||||||
|
check_file "cjk-download/테스트/file-테스트-${{ matrix.runs-on }}.txt" "Content for 테스트"
|
||||||
|
check_file "cjk-download/서울시/file-서울시-${{ matrix.runs-on }}.txt" "Content for 서울시"
|
||||||
|
|
||||||
|
if [ "$fail" -ne 0 ]; then
|
||||||
|
echo "Some CJK artifact checks failed"
|
||||||
|
ls -alR cjk-download/ || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "All CJK artifact downloads verified successfully"
|
||||||
|
|||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/artifact"
|
name: "@actions/artifact"
|
||||||
version: 6.1.0
|
version: 6.2.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Actions artifact lib
|
summary: Actions artifact lib
|
||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/artifact
|
homepage: https://github.com/actions/toolkit/tree/main/packages/artifact
|
||||||
|
|||||||
@@ -4,83 +4,23 @@ Download [Actions Artifacts](https://docs.github.com/en/actions/using-workflows/
|
|||||||
|
|
||||||
See also [upload-artifact](https://github.com/actions/upload-artifact).
|
See also [upload-artifact](https://github.com/actions/upload-artifact).
|
||||||
|
|
||||||
- [`@actions/download-artifact`](#actionsdownload-artifact)
|
- [What's new](#whats-new)
|
||||||
- [v7 - What's new](#v7---whats-new)
|
- [Note](#note)
|
||||||
- [v5 - What's new](#v5---whats-new)
|
- [GHES Support](#ghes-support)
|
||||||
- [v4 - What's new](#v4---whats-new)
|
- [Usage](#usage)
|
||||||
- [Improvements](#improvements)
|
- [Inputs](#inputs)
|
||||||
- [Breaking Changes](#breaking-changes)
|
- [Outputs](#outputs)
|
||||||
- [Note](#note)
|
- [Examples](#examples)
|
||||||
- [Usage](#usage)
|
- [Download Single Artifact](#download-single-artifact)
|
||||||
- [Inputs](#inputs)
|
- [Download Artifacts by ID](#download-artifacts-by-id)
|
||||||
- [Outputs](#outputs)
|
- [Download All Artifacts](#download-all-artifacts)
|
||||||
- [Examples](#examples)
|
- [Download multiple (filtered) Artifacts to the same directory](#download-multiple-filtered-artifacts-to-the-same-directory)
|
||||||
- [Download Single Artifact](#download-single-artifact)
|
- [Download Artifacts from other Workflow Runs or Repositories](#download-artifacts-from-other-workflow-runs-or-repositories)
|
||||||
- [Download Artifacts by ID](#download-artifacts-by-id)
|
- [Maintaining File Permissions](#maintaining-file-permissions)
|
||||||
- [Download All Artifacts](#download-all-artifacts)
|
|
||||||
- [Download multiple (filtered) Artifacts to the same directory](#download-multiple-filtered-artifacts-to-the-same-directory)
|
|
||||||
- [Download Artifacts from other Workflow Runs or Repositories](#download-artifacts-from-other-workflow-runs-or-repositories)
|
|
||||||
- [Limitations](#limitations)
|
|
||||||
- [Permission Loss](#permission-loss)
|
|
||||||
|
|
||||||
## v8 - What's new
|
## What's new
|
||||||
|
|
||||||
> [!IMPORTANT]
|
Check out the [releases page](https://github.com/actions/download-artifact/releases) for details on what's new.
|
||||||
> actions/download-artifact@v8 has been migrated to an ESM module. This should be transparent to the caller but forks might need to make significant changes.
|
|
||||||
|
|
||||||
> [!IMPORTANT]
|
|
||||||
> Hash mismatches will now error by default. Users can override this behavior with a setting change (see below).
|
|
||||||
|
|
||||||
- Downloads will check the content-type returned to determine if a file can be decompressed and skip the decompression stage if so. This removes previous failures where we were trying to decompress a non-zip file. Since this is making a big change to the default behavior, we're making it opt-in via a version bump.
|
|
||||||
- Users can also download a zip file without decompressing it with the new `skip-decompress` flag.
|
|
||||||
|
|
||||||
- Introduces a new parameter `digest-mismatch` that allows callers to specify what to do when the downloaded hash doesn't match the expected hash (`ignore`, `info`, `warn`, `error`). To ensure security by default, the default value is `error`.
|
|
||||||
|
|
||||||
- Chore: we've bumped versions on a lot of our dev packages to get them up to date with the latest bugfixes/security patches.
|
|
||||||
|
|
||||||
## v7 - What's new
|
|
||||||
|
|
||||||
> [!IMPORTANT]
|
|
||||||
> actions/download-artifact@v7 now runs on Node.js 24 (`runs.using: node24`) and requires a minimum Actions Runner version of 2.327.1. If you are using self-hosted runners, ensure they are updated before upgrading.
|
|
||||||
|
|
||||||
### Node.js 24
|
|
||||||
|
|
||||||
This release updates the runtime to Node.js 24. v6 had preliminary support for Node 24, however this action was by default still running on Node.js 20. Now this action by default will run on Node.js 24.
|
|
||||||
|
|
||||||
## v5 - What's new
|
|
||||||
|
|
||||||
Previously, **single artifact downloads** behaved differently depending on how you specified the artifact:
|
|
||||||
|
|
||||||
- **By name**: `name: my-artifact` → extracted to `path/` (direct)
|
|
||||||
- **By ID**: `artifact-ids: 12345` → extracted to `path/my-artifact/` (nested)
|
|
||||||
|
|
||||||
Now both methods are consistent:
|
|
||||||
|
|
||||||
- **By name**: `name: my-artifact` → extracted to `path/` (unchanged)
|
|
||||||
- **By ID**: `artifact-ids: 12345` → extracted to `path/` (updated - now direct)
|
|
||||||
|
|
||||||
Note: This change also applies to patterns that only match a single artifact.
|
|
||||||
|
|
||||||
## v4 - What's new
|
|
||||||
|
|
||||||
> [!IMPORTANT]
|
|
||||||
> download-artifact@v4+ is not currently supported on GitHub Enterprise Server (GHES) yet. If you are on GHES, you must use [v3](https://github.com/actions/download-artifact/releases/tag/v3) (Node 16) or [v3-node20](https://github.com/actions/download-artifact/releases/tag/v3-node20) (Node 20).
|
|
||||||
|
|
||||||
The release of upload-artifact@v4 and download-artifact@v4 are major changes to the backend architecture of Artifacts. They have numerous performance and behavioral improvements.
|
|
||||||
|
|
||||||
For more information, see the [`@actions/artifact`](https://github.com/actions/toolkit/tree/main/packages/artifact) documentation.
|
|
||||||
|
|
||||||
### Improvements
|
|
||||||
|
|
||||||
1. Downloads are significantly faster, upwards of 90% improvement in worst case scenarios.
|
|
||||||
2. Artifacts can be downloaded from other workflow runs and repositories when supplied with a PAT.
|
|
||||||
|
|
||||||
### Breaking Changes
|
|
||||||
|
|
||||||
1. On self hosted runners, additional [firewall rules](https://github.com/actions/toolkit/tree/main/packages/artifact#breaking-changes) may be required.
|
|
||||||
2. Downloading artifacts that were created from `action/upload-artifact@v3` and below are not supported.
|
|
||||||
|
|
||||||
For assistance with breaking changes, see [MIGRATION.md](docs/MIGRATION.md).
|
|
||||||
|
|
||||||
## Note
|
## Note
|
||||||
|
|
||||||
@@ -100,12 +40,16 @@ We will still provide security updates for this project and fix major breaking c
|
|||||||
|
|
||||||
You are welcome to still raise bugs in this repo.
|
You are welcome to still raise bugs in this repo.
|
||||||
|
|
||||||
|
## GHES Support
|
||||||
|
|
||||||
|
`download-artifact@v4+` is not currently supported on GitHub Enterprise Server (GHES) yet. If you are on GHES, you must use [v3](https://github.com/actions/download-artifact/releases/tag/v3) (Node 16) or [v3-node20](https://github.com/actions/download-artifact/releases/tag/v3-node20) (Node 20).
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Inputs
|
### Inputs
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
# Name of the artifact to download.
|
# Name of the artifact to download.
|
||||||
# If unspecified, all artifacts for the run are downloaded.
|
# If unspecified, all artifacts for the run are downloaded.
|
||||||
@@ -147,6 +91,17 @@ You are welcome to still raise bugs in this repo.
|
|||||||
# If github-token is specified, this is the run that artifacts will be downloaded from.
|
# If github-token is specified, this is the run that artifacts will be downloaded from.
|
||||||
# Optional. Default is ${{ github.run_id }}
|
# Optional. Default is ${{ github.run_id }}
|
||||||
run-id:
|
run-id:
|
||||||
|
|
||||||
|
# Whether to skip decompressing a zip file (if detected).
|
||||||
|
# If true, the downloaded artifact will not be automatically extracted/decompressed.
|
||||||
|
# This is useful when you want to handle the artifact as-is without extraction.
|
||||||
|
# Optional. Default is `false`
|
||||||
|
skip-decompress:
|
||||||
|
|
||||||
|
# What to do if the action detects a mismatch between the downloaded hash and the expected hash from the server.
|
||||||
|
# Can be one of: `ignore`, `info`, `warn`, `error`
|
||||||
|
# Optional. Default is `error`
|
||||||
|
digest-mismatch:
|
||||||
```
|
```
|
||||||
|
|
||||||
### Outputs
|
### Outputs
|
||||||
@@ -163,7 +118,7 @@ Download to current working directory (`$GITHUB_WORKSPACE`):
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
- name: Display structure of downloaded files
|
- name: Display structure of downloaded files
|
||||||
@@ -174,7 +129,7 @@ Download to a specific directory (also supports `~` expansion):
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: your/destination/dir
|
path: your/destination/dir
|
||||||
@@ -182,15 +137,24 @@ steps:
|
|||||||
run: ls -R your/destination/dir
|
run: ls -R your/destination/dir
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Directly download a non-zipped file (only supports files uploaded with `actions/upload-artifact@v7` and `archive: false` set):
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: my-artifact.json # corresponds to the uploaded file name
|
||||||
|
```
|
||||||
|
|
||||||
### Download Artifacts by ID
|
### Download Artifacts by ID
|
||||||
|
|
||||||
The `artifact-ids` input allows downloading artifacts using their unique ID rather than name. This is particularly useful when working with immutable artifacts from `actions/upload-artifact@v4` which assigns a unique ID to each artifact.
|
The `artifact-ids` input allows downloading artifacts using their unique ID rather than name. This is particularly useful when working with immutable artifacts from `actions/upload-artifact@v4+` which assigns a unique ID to each artifact.
|
||||||
|
|
||||||
Download a single artifact by ID to the current working directory (`$GITHUB_WORKSPACE`):
|
Download a single artifact by ID to the current working directory (`$GITHUB_WORKSPACE`):
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
artifact-ids: 12345
|
artifact-ids: 12345
|
||||||
- name: Display structure of downloaded files
|
- name: Display structure of downloaded files
|
||||||
@@ -201,7 +165,7 @@ Download a single artifact by ID to a specific directory:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
artifact-ids: 12345
|
artifact-ids: 12345
|
||||||
path: your/destination/dir
|
path: your/destination/dir
|
||||||
@@ -215,7 +179,7 @@ Multiple artifacts can be downloaded by providing a comma-separated list of IDs:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
artifact-ids: 12345,67890
|
artifact-ids: 12345,67890
|
||||||
path: path/to/artifacts
|
path: path/to/artifacts
|
||||||
@@ -243,7 +207,7 @@ Download all artifacts to the current working directory:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@v8
|
||||||
- name: Display structure of downloaded files
|
- name: Display structure of downloaded files
|
||||||
run: ls -R
|
run: ls -R
|
||||||
```
|
```
|
||||||
@@ -252,7 +216,7 @@ Download all artifacts to a specific directory:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
path: path/to/artifacts
|
path: path/to/artifacts
|
||||||
- name: Display structure of downloaded files
|
- name: Display structure of downloaded files
|
||||||
@@ -263,7 +227,7 @@ To download them to the _same_ directory:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
path: path/to/artifacts
|
path: path/to/artifacts
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
@@ -294,7 +258,7 @@ jobs:
|
|||||||
- name: Create a File
|
- name: Create a File
|
||||||
run: echo "hello from ${{ matrix.runs-on }}" > file-${{ matrix.runs-on }}.txt
|
run: echo "hello from ${{ matrix.runs-on }}" > file-${{ matrix.runs-on }}.txt
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact-${{ matrix.runs-on }}
|
name: my-artifact-${{ matrix.runs-on }}
|
||||||
path: file-${{ matrix.runs-on }}.txt
|
path: file-${{ matrix.runs-on }}.txt
|
||||||
@@ -303,7 +267,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Download All Artifacts
|
- name: Download All Artifacts
|
||||||
uses: actions/download-artifact@v5
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
path: my-artifact
|
path: my-artifact
|
||||||
pattern: my-artifact-*
|
pattern: my-artifact-*
|
||||||
@@ -326,7 +290,7 @@ It may be useful to download Artifacts from other workflow runs, or even other r
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: my-other-artifact
|
name: my-other-artifact
|
||||||
github-token: ${{ secrets.GH_PAT }} # token with actions:read permissions on target repo
|
github-token: ${{ secrets.GH_PAT }} # token with actions:read permissions on target repo
|
||||||
@@ -334,21 +298,30 @@ steps:
|
|||||||
run-id: 1234
|
run-id: 1234
|
||||||
```
|
```
|
||||||
|
|
||||||
## Limitations
|
### Maintaining File Permissions
|
||||||
|
|
||||||
### Permission Loss
|
Zipping files will remove file permissions during artifact upload. All directories will have `755` and all files will have `644`. For example, if you make a file executable using `chmod` and then upload that file as a zip file, post-download the file is no longer guaranteed to be set as an executable.
|
||||||
|
|
||||||
File permissions are not maintained during artifact upload. All directories will have `755` and all files will have `644`. For example, if you make a file executable using `chmod` and then upload that file, post-download the file is no longer guaranteed to be set as an executable.
|
If you must preserve permissions, you can `tar` all of your files together before artifact upload and upload it as a single file (using V7+ of `actions/upload-artifact`). Then download the file directly and unpack it manually:
|
||||||
|
|
||||||
If you must preserve permissions, you can `tar` all of your files together before artifact upload. Post download, the `tar` file will maintain file permissions and case sensitivity.
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|
||||||
- name: 'Tar files'
|
- name: 'Tar files'
|
||||||
run: tar -cvf my_files.tar /path/to/my/directory
|
run: tar -cvf my_files.tar /path/to/my/directory
|
||||||
|
|
||||||
- name: 'Upload Artifact'
|
- name: 'Upload Artifact'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
|
||||||
path: my_files.tar
|
path: my_files.tar
|
||||||
```
|
archive: false
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
# Later, download the file by name
|
||||||
|
|
||||||
|
- name: 'Download Artifact'
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: my_files.tar
|
||||||
|
|
||||||
|
```
|
||||||
Vendored
+192
-270
File diff suppressed because one or more lines are too long
Generated
+6
-6
@@ -1,15 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "download-artifact",
|
"name": "download-artifact",
|
||||||
"version": "7.0.0",
|
"version": "8.0.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "download-artifact",
|
"name": "download-artifact",
|
||||||
"version": "7.0.0",
|
"version": "8.0.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/artifact": "^6.1.0",
|
"@actions/artifact": "^6.2.1",
|
||||||
"@actions/core": "^3.0.0",
|
"@actions/core": "^3.0.0",
|
||||||
"minimatch": "^10.1.1"
|
"minimatch": "^10.1.1"
|
||||||
},
|
},
|
||||||
@@ -36,9 +36,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/artifact": {
|
"node_modules/@actions/artifact": {
|
||||||
"version": "6.1.0",
|
"version": "6.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-6.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-6.2.1.tgz",
|
||||||
"integrity": "sha512-oRn9YhKkboXgIq2TQZ9uj6bhkT5ZUzFtnyTQ0tLGBwImaD0GfWShE5R0tPbN25EJmS3tz5sDd2JnVokAOtNrZQ==",
|
"integrity": "sha512-sJGH0mhEbEjBCw7o6SaLhUU66u27aFW8HTfkIb5Tk2/Wy0caUDc+oYQEgnuFN7a0HCpAbQyK0U6U7XUJDgDWrw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^3.0.0",
|
"@actions/core": "^3.0.0",
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "download-artifact",
|
"name": "download-artifact",
|
||||||
"version": "8.0.0",
|
"version": "8.0.1",
|
||||||
"description": "Download an Actions Artifact from a workflow run",
|
"description": "Download an Actions Artifact from a workflow run",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/actions/download-artifact#readme",
|
"homepage": "https://github.com/actions/download-artifact#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/artifact": "^6.1.0",
|
"@actions/artifact": "^6.2.1",
|
||||||
"@actions/core": "^3.0.0",
|
"@actions/core": "^3.0.0",
|
||||||
"minimatch": "^10.1.1"
|
"minimatch": "^10.1.1"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user