Skip to content

Commit 0b3de3e

Browse files
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`
1 parent 54f3f7f commit 0b3de3e

File tree

1 file changed

+46
-41
lines changed

1 file changed

+46
-41
lines changed

README.md

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ See also [download-artifact](https://github.com/actions/download-artifact).
66

77
# What's new
88

9-
- Easier upload
9+
- Easier upload
1010
- Specify a wildcard pattern
1111
- Specify an individual file
1212
- 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
2525
See [action.yml](action.yml)
2626

2727
### Upload an Individual File
28+
2829
```yaml
2930
steps:
3031
- uses: actions/checkout@v2
@@ -49,6 +50,7 @@ steps:
4950
```
5051
5152
### Upload using a Wildcard Pattern
53+
5254
```yaml
5355
- uses: actions/upload-artifact@v2
5456
with:
@@ -57,6 +59,7 @@ steps:
5759
```
5860
5961
### Upload using Multiple Paths and Exclusions
62+
6063
```yaml
6164
- uses: actions/upload-artifact@v2
6265
with:
@@ -69,19 +72,20 @@ steps:
6972
7073
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.
7174
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:
7376
7477
```
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
8487
```
88+
8589
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.
8690

8791
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
9094

9195
### Customization if no files are found
9296

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:
9498

9599
```yaml
96100
- uses: actions/upload-artifact@v2
97101
with:
98102
name: my-artifact
99103
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`
101105
```
102106
103107
### Conditional Artifact Upload
@@ -115,6 +119,7 @@ To upload artifacts only when the previous step of a job failed, use [`if: failu
115119
### Uploading without an artifact name
116120

117121
You can upload an artifact without specifying a name
122+
118123
```yaml
119124
- uses: actions/upload-artifact@v2
120125
with:
@@ -125,7 +130,7 @@ If not provided, `artifact` will be used as the default name which will manifest
125130

126131
### Uploading to the same artifact
127132

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`):
129134

130135
```yaml
131136
- run: echo hi > world.txt
@@ -144,59 +149,59 @@ With the following example, the available artifact (named `artifact` by default
144149
path: world.txt
145150
```
146151

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
148153

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:
150155

151156
```yaml
152157
strategy:
153158
matrix:
154159
node-version: [8.x, 10.x, 12.x, 13.x]
155160
steps:
156-
- name: 'Create a file'
161+
- name: Create a file
157162
run: echo ${{ matrix.node-version }} > my_file.txt
158-
- 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
160165
with:
161166
name: my-artifact
162167
path: ${{ github.workspace }}
163168
```
164169

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:
166171

167172
```yaml
168-
uses: 'actions/upload-artifact@v2'
173+
uses: actions/upload-artifact@v2
169174
with:
170175
name: my-artifact ${{ matrix.node-version }}
171176
path: ${{ github.workspace }}
172177
```
173178

174179
### Environment Variables and Tilde Expansion
175180

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:
177182

178183
```yaml
179-
- run: |
184+
- run: |
180185
mkdir -p ~/new/artifact
181186
echo hello > ~/new/artifact/world.txt
182187
- uses: actions/upload-artifact@v2
183-
with:
184-
name: 'Artifacts-V2'
185-
path: '~/new/**/*'
188+
with:
189+
name: Artifacts-V2
190+
path: ~/new/**/*
186191
```
187192

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):
189194

190195
```yaml
191196
env:
192197
name: my-artifact
193198
steps:
194-
- run: |
199+
- run: |
195200
mkdir -p ${{ github.workspace }}/artifact
196201
echo hello > ${{ github.workspace }}/artifact/world.txt
197202
- uses: actions/upload-artifact@v2
198-
with:
199-
name: ${{ env.name }}-name
203+
with:
204+
name: ${{ env.name }}-name
200205
path: ${{ github.workspace }}/artifact/**/*
201206
```
202207

@@ -205,16 +210,15 @@ Environment variables along with context expressions can also be used for input.
205210
Artifacts are retained for 90 days by default. You can specify a shorter retention period using the `retention-days` input:
206211

207212
```yaml
208-
- name: 'Create a file'
213+
- name: Create a file
209214
run: echo "I won't live long" > my_file.txt
210215
211-
- name: 'Upload Artifact'
216+
- name: Upload Artifact
212217
uses: actions/upload-artifact@v2
213218
with:
214219
name: my-artifact
215220
path: my_file.txt
216221
retention-days: 5
217-
218222
```
219223

220224
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
233237

234238
### Zipped Artifact Downloads
235239

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.
237241

238242
### Permission Loss
239243

@@ -245,18 +249,19 @@ During a workflow run, files are uploaded and downloaded individually using the
245249

246250
### Maintaining file permissions and case sensitive files
247251

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:
249253

250254
```yaml
251-
- name: 'Tar files'
255+
- name: Tar files
252256
run: tar -cvf my_files.tar /path/to/my/directory
253257
254-
- name: 'Upload Artifact'
258+
- name: Upload Artifact
255259
uses: actions/upload-artifact@v2
256260
with:
257261
name: my-artifact
258-
path: my_files.tar
262+
path: my_files.tar
259263
```
264+
260265
### Too many uploads resulting in 429 responses
261266

262267
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
265270

266271
## Additional Documentation
267272

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.
269274

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.
271276

272277
# License
273278

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

Comments
 (0)