mirror of
https://github.com/actions/download-artifact
synced 2025-09-22 11:47:52 +00:00
Compare commits
8 commits
9ca1ff346a
...
f2e6f2d205
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f2e6f2d205 | ||
![]() |
de96f4613b | ||
![]() |
7993cb44e9 | ||
![]() |
2653c123b8 | ||
![]() |
7d782037f3 | ||
![]() |
1c80d4491e | ||
![]() |
797c81d14e | ||
![]() |
93d8a15b3b |
7 changed files with 107 additions and 24 deletions
4
.github/workflows/check-dist.yml
vendored
4
.github/workflows/check-dist.yml
vendored
|
@ -20,10 +20,10 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node 20
|
||||
- name: Setup Node 24
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
node-version: 24.x
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
|
|
49
.github/workflows/test-node24-workflow.yml
vendored
Normal file
49
.github/workflows/test-node24-workflow.yml
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
name: Test with Node.js 24
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ node24 ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test-node24:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# Setup with Node.js 24
|
||||
- name: Setup Node.js 24
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '24'
|
||||
|
||||
# Create a test artifact
|
||||
- name: Create test file
|
||||
run: |
|
||||
mkdir -p test-artifact
|
||||
echo "Hello from Node.js 24" > test-artifact/test.txt
|
||||
|
||||
# Upload the test artifact
|
||||
- name: Upload test artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test-artifact
|
||||
path: test-artifact
|
||||
|
||||
# Download using this action
|
||||
- name: Download with the updated action
|
||||
uses: ./
|
||||
with:
|
||||
name: test-artifact
|
||||
path: downloaded-artifact
|
||||
|
||||
# Verify download succeeded
|
||||
- name: Verify download
|
||||
run: |
|
||||
if [ -f "downloaded-artifact/test.txt" ]; then
|
||||
echo "✅ Download succeeded!"
|
||||
cat downloaded-artifact/test.txt
|
||||
else
|
||||
echo "❌ Download failed!"
|
||||
exit 1
|
||||
fi
|
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
|
@ -22,10 +22,10 @@ jobs:
|
|||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node 20
|
||||
- name: Setup Node 24
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
node-version: 24.x
|
||||
cache: 'npm'
|
||||
|
||||
- name: npm install
|
||||
|
|
34
README.md
34
README.md
|
@ -5,6 +5,7 @@ Download [Actions Artifacts](https://docs.github.com/en/actions/using-workflows/
|
|||
See also [upload-artifact](https://github.com/actions/upload-artifact).
|
||||
|
||||
- [`@actions/download-artifact`](#actionsdownload-artifact)
|
||||
- [v5 - What's new](#v5---whats-new)
|
||||
- [v4 - What's new](#v4---whats-new)
|
||||
- [Improvements](#improvements)
|
||||
- [Breaking Changes](#breaking-changes)
|
||||
|
@ -21,6 +22,17 @@ See also [upload-artifact](https://github.com/actions/upload-artifact).
|
|||
- [Limitations](#limitations)
|
||||
- [Permission Loss](#permission-loss)
|
||||
|
||||
## 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)
|
||||
|
||||
## v4 - What's new
|
||||
|
||||
|
@ -66,7 +78,7 @@ You are welcome to still raise bugs in this repo.
|
|||
### Inputs
|
||||
|
||||
```yaml
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v5
|
||||
with:
|
||||
# Name of the artifact to download.
|
||||
# If unspecified, all artifacts for the run are downloaded.
|
||||
|
@ -124,7 +136,7 @@ Download to current working directory (`$GITHUB_WORKSPACE`):
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: my-artifact
|
||||
- name: Display structure of downloaded files
|
||||
|
@ -135,7 +147,7 @@ Download to a specific directory (also supports `~` expansion):
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: my-artifact
|
||||
path: your/destination/dir
|
||||
|
@ -151,7 +163,7 @@ Download a single artifact by ID to the current working directory (`$GITHUB_WORK
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v5
|
||||
with:
|
||||
artifact-ids: 12345
|
||||
- name: Display structure of downloaded files
|
||||
|
@ -162,7 +174,7 @@ Download a single artifact by ID to a specific directory:
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v5
|
||||
with:
|
||||
artifact-ids: 12345
|
||||
path: your/destination/dir
|
||||
|
@ -176,7 +188,7 @@ Multiple artifacts can be downloaded by providing a comma-separated list of IDs:
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v5
|
||||
with:
|
||||
artifact-ids: 12345,67890
|
||||
path: path/to/artifacts
|
||||
|
@ -204,7 +216,7 @@ Download all artifacts to the current working directory:
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v5
|
||||
- name: Display structure of downloaded files
|
||||
run: ls -R
|
||||
```
|
||||
|
@ -213,7 +225,7 @@ Download all artifacts to a specific directory:
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v5
|
||||
with:
|
||||
path: path/to/artifacts
|
||||
- name: Display structure of downloaded files
|
||||
|
@ -224,7 +236,7 @@ To download them to the _same_ directory:
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v5
|
||||
with:
|
||||
path: path/to/artifacts
|
||||
merge-multiple: true
|
||||
|
@ -264,7 +276,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download All Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
path: my-artifact
|
||||
pattern: my-artifact-*
|
||||
|
@ -287,7 +299,7 @@ It may be useful to download Artifacts from other workflow runs, or even other r
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: my-other-artifact
|
||||
github-token: ${{ secrets.GH_PAT }} # token with actions:read permissions on target repo
|
||||
|
|
|
@ -39,5 +39,5 @@ outputs:
|
|||
download-path:
|
||||
description: 'Path of artifact download'
|
||||
runs:
|
||||
using: 'node20'
|
||||
using: 'node24'
|
||||
main: 'dist/index.js'
|
||||
|
|
33
package-lock.json
generated
33
package-lock.json
generated
|
@ -16,7 +16,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "^12.12.6",
|
||||
"@types/node": "^24.1.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
||||
"@vercel/ncc": "^0.33.4",
|
||||
"concurrently": "^5.2.0",
|
||||
|
@ -28,6 +28,9 @@
|
|||
"ts-jest": "^29.2.6",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
}
|
||||
},
|
||||
"node_modules/@aashutoshrathi/word-wrap": {
|
||||
|
@ -2271,9 +2274,12 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "12.12.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.6.tgz",
|
||||
"integrity": "sha512-FjsYUPzEJdGXjwKqSpE0/9QEh6kzhTAeObA54rn6j3rR4C/mzpI9L0KNfoeASSPMMdxIsoJuCLDWcM/rVjIsSA=="
|
||||
"version": "24.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz",
|
||||
"integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==",
|
||||
"dependencies": {
|
||||
"undici-types": "~7.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node-fetch": {
|
||||
"version": "2.6.9",
|
||||
|
@ -10192,6 +10198,11 @@
|
|||
"node": ">=14.0"
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "7.8.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
|
||||
"integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw=="
|
||||
},
|
||||
"node_modules/universal-user-agent": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
|
||||
|
@ -12471,9 +12482,12 @@
|
|||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "12.12.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.6.tgz",
|
||||
"integrity": "sha512-FjsYUPzEJdGXjwKqSpE0/9QEh6kzhTAeObA54rn6j3rR4C/mzpI9L0KNfoeASSPMMdxIsoJuCLDWcM/rVjIsSA=="
|
||||
"version": "24.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz",
|
||||
"integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==",
|
||||
"requires": {
|
||||
"undici-types": "~7.8.0"
|
||||
}
|
||||
},
|
||||
"@types/node-fetch": {
|
||||
"version": "2.6.9",
|
||||
|
@ -18199,6 +18213,11 @@
|
|||
"@fastify/busboy": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"undici-types": {
|
||||
"version": "7.8.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
|
||||
"integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw=="
|
||||
},
|
||||
"universal-user-agent": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
"url": "https://github.com/actions/download-artifact/issues"
|
||||
},
|
||||
"homepage": "https://github.com/actions/download-artifact#readme",
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/artifact": "^2.3.2",
|
||||
"@actions/core": "^1.10.1",
|
||||
|
@ -36,7 +39,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "^12.12.6",
|
||||
"@types/node": "^24.1.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
||||
"@vercel/ncc": "^0.33.4",
|
||||
"concurrently": "^5.2.0",
|
||||
|
|
Loading…
Reference in a new issue