You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix README.md links and some formatting updates (#273)
* Some `README.md` whitespace and tweaks
* Fix link and title to GitHub documentation page on `README.md`
* Update link to `actions/toolkit` documentation
* De-quote some YAML blocks/examples in `README.md`
Copy file name to clipboardExpand all lines: README.md
+46-41Lines changed: 46 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ See also [download-artifact](https://github.com/actions/download-artifact).
6
6
7
7
# What's new
8
8
9
-
- Easier upload
9
+
- Easier upload
10
10
- Specify a wildcard pattern
11
11
- Specify an individual file
12
12
- Specify a directory (previously you were limited to only this option)
@@ -25,6 +25,7 @@ Refer [here](https://github.com/actions/upload-artifact/tree/releases/v1) for th
25
25
See [action.yml](action.yml)
26
26
27
27
### Upload an Individual File
28
+
28
29
```yaml
29
30
steps:
30
31
- uses: actions/checkout@v2
@@ -49,6 +50,7 @@ steps:
49
50
```
50
51
51
52
### Upload using a Wildcard Pattern
53
+
52
54
```yaml
53
55
- uses: actions/upload-artifact@v2
54
56
with:
@@ -57,6 +59,7 @@ steps:
57
59
```
58
60
59
61
### Upload using Multiple Paths and Exclusions
62
+
60
63
```yaml
61
64
- uses: actions/upload-artifact@v2
62
65
with:
@@ -69,19 +72,20 @@ steps:
69
72
70
73
For supported wildcards along with behavior and documentation, see [@actions/glob](https://github.com/actions/toolkit/tree/main/packages/glob) which is used internally to search for files.
71
74
72
-
If a wildcard pattern is used, the path hierarchy will be preserved after the first wildcard pattern.
75
+
If a wildcard pattern is used, the path hierarchy will be preserved after the first wildcard pattern:
73
76
74
77
```
75
-
path/to/*/directory/foo?.txt =>
76
-
∟ path/to/some/directory/foo1.txt
77
-
∟ path/to/some/directory/foo2.txt
78
-
∟ path/to/other/directory/foo1.txt
79
-
80
-
would be flattened and uploaded as =>
81
-
∟ some/directory/foo1.txt
82
-
∟ some/directory/foo2.txt
83
-
∟ other/directory/foo1.txt
78
+
path/to/*/directory/foo?.txt =>
79
+
∟ path/to/some/directory/foo1.txt
80
+
∟ path/to/some/directory/foo2.txt
81
+
∟ path/to/other/directory/foo1.txt
82
+
83
+
would be flattened and uploaded as =>
84
+
∟ some/directory/foo1.txt
85
+
∟ some/directory/foo2.txt
86
+
∟ other/directory/foo1.txt
84
87
```
88
+
85
89
If multiple paths are provided as input, the least common ancestor of all the search paths will be used as the root directory of the artifact. Exclude paths do not affect the directory structure.
86
90
87
91
Relative and absolute file paths are both allowed. Relative paths are rooted against the current working directory. Paths that begin with a wildcard character should be quoted to avoid being interpreted as YAML aliases.
@@ -90,14 +94,14 @@ The [@actions/artifact](https://github.com/actions/toolkit/tree/main/packages/ar
90
94
91
95
### Customization if no files are found
92
96
93
-
If a path (or paths), result in no files being found for the artifact, the action will succeed but print out a warning. In certain scenarios it may be desirable to fail the action or suppress the warning. The `if-no-files-found` option allows you to customize the behavior of the action if no files are found.
97
+
If a path (or paths), result in no files being found for the artifact, the action will succeed but print out a warning. In certain scenarios it may be desirable to fail the action or suppress the warning. The `if-no-files-found` option allows you to customize the behavior of the action if no files are found:
94
98
95
99
```yaml
96
100
- uses: actions/upload-artifact@v2
97
101
with:
98
102
name: my-artifact
99
103
path: path/to/artifact/
100
-
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
104
+
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
101
105
```
102
106
103
107
### Conditional Artifact Upload
@@ -115,6 +119,7 @@ To upload artifacts only when the previous step of a job failed, use [`if: failu
115
119
### Uploading without an artifact name
116
120
117
121
You can upload an artifact without specifying a name
122
+
118
123
```yaml
119
124
- uses: actions/upload-artifact@v2
120
125
with:
@@ -125,7 +130,7 @@ If not provided, `artifact` will be used as the default name which will manifest
125
130
126
131
### Uploading to the same artifact
127
132
128
-
With the following example, the available artifact (named `artifact` by default if no name is provided) would contain both `world.txt` (`hello`) and `extra-file.txt` (`howdy`).
133
+
With the following example, the available artifact (named `artifact` by default if no name is provided) would contain both `world.txt` (`hello`) and `extra-file.txt` (`howdy`):
129
134
130
135
```yaml
131
136
- run: echo hi > world.txt
@@ -144,59 +149,59 @@ With the following example, the available artifact (named `artifact` by default
144
149
path: world.txt
145
150
```
146
151
147
-
> **_Warning:_** Be careful when uploading to the same artifact via multiple jobs as artifacts may become corrupted
152
+
> **_Warning:_** Be careful when uploading to the same artifact via multiple jobs as artifacts may become corrupted
148
153
149
-
Each artifact behaves as a file share. Uploading to the same artifact multiple times in the same workflow can overwrite and append already uploaded files
154
+
Each artifact behaves as a file share. Uploading to the same artifact multiple times in the same workflow can overwrite and append already uploaded files:
- name: 'Accidently upload to the same artifact via multiple jobs'
159
-
uses: 'actions/upload-artifact@v2'
163
+
- name: Accidently upload to the same artifact via multiple jobs
164
+
uses: actions/upload-artifact@v2
160
165
with:
161
166
name: my-artifact
162
167
path: ${{ github.workspace }}
163
168
```
164
169
165
-
In the above example, four jobs will upload four different files to the same artifact but there will only be one file available when `my-artifact` is downloaded. Each job overwrites what was previously uploaded. To ensure that jobs don't overwrite existing artifacts, use a different name per job.
170
+
In the above example, four jobs will upload four different files to the same artifact but there will only be one file available when `my-artifact` is downloaded. Each job overwrites what was previously uploaded. To ensure that jobs don't overwrite existing artifacts, use a different name per job:
166
171
167
172
```yaml
168
-
uses: 'actions/upload-artifact@v2'
173
+
uses: actions/upload-artifact@v2
169
174
with:
170
175
name: my-artifact ${{ matrix.node-version }}
171
176
path: ${{ github.workspace }}
172
177
```
173
178
174
179
### Environment Variables and Tilde Expansion
175
180
176
-
You can use `~` in the path input as a substitute for `$HOME`. Basic tilde expansion is supported.
181
+
You can use `~` in the path input as a substitute for `$HOME`. Basic tilde expansion is supported:
177
182
178
183
```yaml
179
-
- run: |
184
+
- run: |
180
185
mkdir -p ~/new/artifact
181
186
echo hello > ~/new/artifact/world.txt
182
187
- uses: actions/upload-artifact@v2
183
-
with:
184
-
name: 'Artifacts-V2'
185
-
path: '~/new/**/*'
188
+
with:
189
+
name: Artifacts-V2
190
+
path: ~/new/**/*
186
191
```
187
192
188
-
Environment variables along with context expressions can also be used for input. For documentation see [context and expression syntax](https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions).
193
+
Environment variables along with context expressions can also be used for input. For documentation see [context and expression syntax](https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions):
@@ -205,16 +210,15 @@ Environment variables along with context expressions can also be used for input.
205
210
Artifacts are retained for 90 days by default. You can specify a shorter retention period using the `retention-days` input:
206
211
207
212
```yaml
208
-
- name: 'Create a file'
213
+
- name: Create a file
209
214
run: echo "I won't live long" > my_file.txt
210
215
211
-
- name: 'Upload Artifact'
216
+
- name: Upload Artifact
212
217
uses: actions/upload-artifact@v2
213
218
with:
214
219
name: my-artifact
215
220
path: my_file.txt
216
221
retention-days: 5
217
-
218
222
```
219
223
220
224
The retention period must be between 1 and 90 inclusive. For more information see [artifact and log retention policies](https://docs.github.com/en/free-pro-team@latest/actions/reference/usage-limits-billing-and-administration#artifact-and-log-retention-policy).
@@ -233,7 +237,7 @@ The size of the artifact is denoted in bytes. The displayed artifact size denote
233
237
234
238
### Zipped Artifact Downloads
235
239
236
-
During a workflow run, files are uploaded and downloaded individually using the `upload-artifact` and `download-artifact` actions. However, when a workflow run finishes and an artifact is downloaded from either the UI or through the [download api](https://developer.github.com/v3/actions/artifacts/#download-an-artifact), a zip is dynamically created with all the file contents that were uploaded. There is currently no way to download artifacts after a workflow run finishes in a format other than a zip or to download artifact contents individually. One of the consequences of this limitation is that if a zip is uploaded during a workflow run and then downloaded from the UI, there will be a double zip created.
240
+
During a workflow run, files are uploaded and downloaded individually using the `upload-artifact` and `download-artifact` actions. However, when a workflow run finishes and an artifact is downloaded from either the UI or through the [download api](https://developer.github.com/v3/actions/artifacts/#download-an-artifact), a zip is dynamically created with all the file contents that were uploaded. There is currently no way to download artifacts after a workflow run finishes in a format other than a zip or to download artifact contents individually. One of the consequences of this limitation is that if a zip is uploaded during a workflow run and then downloaded from the UI, there will be a double zip created.
237
241
238
242
### Permission Loss
239
243
@@ -245,18 +249,19 @@ During a workflow run, files are uploaded and downloaded individually using the
245
249
246
250
### Maintaining file permissions and case sensitive files
247
251
248
-
If file permissions and case sensitivity are required, you can `tar` all of your files together before artifact upload. Post download, the `tar` file will maintain file permissions and case sensitivity.
252
+
If file permissions and case sensitivity are required, you can `tar` all of your files together before artifact upload. Post download, the `tar` file will maintain file permissions and case sensitivity:
249
253
250
254
```yaml
251
-
- name: 'Tar files'
255
+
- name: Tar files
252
256
run: tar -cvf my_files.tar /path/to/my/directory
253
257
254
-
- name: 'Upload Artifact'
258
+
- name: Upload Artifact
255
259
uses: actions/upload-artifact@v2
256
260
with:
257
261
name: my-artifact
258
-
path: my_files.tar
262
+
path: my_files.tar
259
263
```
264
+
260
265
### Too many uploads resulting in 429 responses
261
266
262
267
A very minute subset of users who upload a very very large amount of artifacts in a short period of time may see their uploads throttled or fail because of `Request was blocked due to exceeding usage of resource 'DBCPU' in namespace` or `Unable to copy file to server StatusCode=TooManyRequests`.
@@ -265,10 +270,10 @@ To reduce the chance of this happening, you can reduce the number of HTTP calls
265
270
266
271
## Additional Documentation
267
272
268
-
See [persisting workflow data using artifacts](https://help.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts) for additional examples and tips.
273
+
See [Storing workflow data as artifacts](https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts) for additional examples and tips.
269
274
270
-
See extra documentation for the [@actions/artifact](https://github.com/actions/toolkit/blob/master/packages/artifact/docs/additional-information.md) package that is used internally regarding certain behaviors and limitations.
275
+
See extra documentation for the [@actions/artifact](https://github.com/actions/toolkit/blob/main/packages/artifact/docs/additional-information.md) package that is used internally regarding certain behaviors and limitations.
271
276
272
277
# License
273
278
274
-
The scripts and documentation in this project are released under the [MIT License](LICENSE)
279
+
The scripts and documentation in this project are released under the [MIT License](LICENSE).
0 commit comments