Skip to content

Commit bff23f9

Browse files
committed
update docs
1 parent fff8c14 commit bff23f9

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ See also [upload-artifact](https://github.com/actions/upload-artifact).
88
- [v4 - What's new](#v4---whats-new)
99
- [Improvements](#improvements)
1010
- [Breaking Changes](#breaking-changes)
11+
- [Note](#note)
1112
- [Usage](#usage)
1213
- [Inputs](#inputs)
1314
- [Outputs](#outputs)
@@ -89,6 +90,7 @@ You are welcome to still raise bugs in this repo.
8990
# When multiple artifacts are matched, this changes the behavior of the destination directories.
9091
# If true, the downloaded artifacts will be in the same directory specified by path.
9192
# If false, the downloaded artifacts will be extracted into individual named directories within the specified path.
93+
# Note: When downloading a single artifact (by name or ID), it will always be extracted directly to the specified path.
9294
# Optional. Default is 'false'
9395
merge-multiple:
9496

@@ -145,6 +147,8 @@ steps:
145147

146148
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.
147149

150+
Download a single artifact by ID to the current working directory (`$GITHUB_WORKSPACE`):
151+
148152
```yaml
149153
steps:
150154
- uses: actions/download-artifact@v4
@@ -154,6 +158,20 @@ steps:
154158
run: ls -R
155159
```
156160

161+
Download a single artifact by ID to a specific directory:
162+
163+
```yaml
164+
steps:
165+
- uses: actions/download-artifact@v4
166+
with:
167+
artifact-ids: 12345
168+
path: your/destination/dir
169+
- name: Display structure of downloaded files
170+
run: ls -R your/destination/dir
171+
```
172+
173+
When downloading a single artifact by ID, the behavior is identical to downloading by name - the artifact contents are extracted directly to the specified path without creating a subdirectory.
174+
157175
Multiple artifacts can be downloaded by providing a comma-separated list of IDs:
158176

159177
```yaml
@@ -166,7 +184,7 @@ steps:
166184
run: ls -R path/to/artifacts
167185
```
168186

169-
This will download multiple artifacts to separate directories (similar to downloading multiple artifacts by name).
187+
When downloading multiple artifacts by ID, each artifact will be extracted into its own subdirectory named after the artifact (similar to downloading multiple artifacts by name).
170188

171189
### Download All Artifacts
172190

0 commit comments

Comments
 (0)