mirror of
https://github.com/actions/upload-artifact.git
synced 2025-06-14 15:57:12 +02:00
Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
27121b0bdf | |||
4537e112f4 | |||
2368feccd5 | |||
52a3c6b975 | |||
76f4433885 | |||
46426468d3 | |||
8507687653 | |||
0482dbbe7a | |||
58518184d2 | |||
4db8255e70 | |||
9243a41f97 | |||
9dc0ee81a2 | |||
2e3d6da508 | |||
ee69f02b3d | |||
bcd44ad93d | |||
ea3d524381 | |||
e95d1b9c8d | |||
0fbc4b771a | |||
a1af2e8f43 | |||
a4f98af3fa | |||
16b8b2b2e7 | |||
e448a9b857 | |||
e6bd6b7749 | |||
1fd4c858f9 | |||
a2af908e3a | |||
928d1a16d9 | |||
e4a7ffadfc |
1
.github/CODEOWNERS
vendored
Normal file
1
.github/CODEOWNERS
vendored
Normal file
@ -0,0 +1 @@
|
||||
* @actions/artifacts-actions
|
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@ -2,6 +2,8 @@ name: "Code scanning - action"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore: "dependabot/**"
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
schedule:
|
||||
|
2
.licenses/npm/@actions/artifact.dep.yml
generated
2
.licenses/npm/@actions/artifact.dep.yml
generated
@ -1,6 +1,6 @@
|
||||
---
|
||||
name: "@actions/artifact"
|
||||
version: 0.4.0
|
||||
version: 0.5.2
|
||||
type: npm
|
||||
summary:
|
||||
homepage:
|
||||
|
2
.licenses/npm/@actions/http-client.dep.yml
generated
2
.licenses/npm/@actions/http-client.dep.yml
generated
@ -1,6 +1,6 @@
|
||||
---
|
||||
name: "@actions/http-client"
|
||||
version: 1.0.8
|
||||
version: 1.0.11
|
||||
type: npm
|
||||
summary: Actions Http Client
|
||||
homepage: https://github.com/actions/http-client#readme
|
||||
|
55
README.md
55
README.md
@ -82,7 +82,7 @@ If a wildcard pattern is used, the path hierarchy will be preserved after the fi
|
||||
∟ some/directory/foo2.txt
|
||||
∟ other/directory/foo1.txt
|
||||
```
|
||||
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 effect the directory structure.
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
@ -125,7 +125,7 @@ If not provided, `artifact` will be used as the default name which will manifest
|
||||
|
||||
### Uploading to the same artifact
|
||||
|
||||
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
|
||||
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`).
|
||||
|
||||
```yaml
|
||||
- run: echo hi > world.txt
|
||||
@ -143,10 +143,11 @@ Each artifact behaves as a file share. Uploading to the same artifact multiple t
|
||||
with:
|
||||
path: world.txt
|
||||
```
|
||||
With the following example, the available artifact (named `artifact` which is the default if no name is provided) would contain both `world.txt` (`hello`) and `extra-file.txt` (`howdy`).
|
||||
|
||||
> **_Warning:_** Be careful when uploading to the same artifact via multiple jobs as artifacts may become corrupted
|
||||
|
||||
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
|
||||
|
||||
```yaml
|
||||
strategy:
|
||||
matrix:
|
||||
@ -199,12 +200,35 @@ Environment variables along with context expressions can also be used for input.
|
||||
path: ${{ github.workspace }}/artifact/**/*
|
||||
```
|
||||
|
||||
### Retention Period
|
||||
|
||||
Artifacts are retained for 90 days by default. You can specify a shorter retention period using the `retention-days` input:
|
||||
|
||||
```yaml
|
||||
- name: 'Create a file'
|
||||
run: echo "I won't live long" > my_file.txt
|
||||
|
||||
- name: 'Upload Artifact'
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: my-artifact
|
||||
path: my_file.txt
|
||||
retention-days: 5
|
||||
|
||||
```
|
||||
|
||||
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).
|
||||
|
||||
## Where does the upload go?
|
||||
In the top right corner of a workflow run, once the run is over, if you used this action, there will be an `Artifacts` dropdown which you can download items from. Here's a screenshot of what it looks like<br/>
|
||||
<img src="https://user-images.githubusercontent.com/16109154/72556687-20235a80-386d-11ea-9e2a-b534faa77083.png" width="375" height="140">
|
||||
|
||||
At the bottom of the workflow summary page, there is a dedicated section for artifacts. Here's a screenshot of something you might see:
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/16109154/103645952-223c6880-4f59-11eb-8268-8dca6937b5f9.png" width="700" height="300">
|
||||
|
||||
There is a trashcan icon that can be used to delete the artifact. This icon will only appear for users who have write permissions to the repository.
|
||||
|
||||
The size of the artifact is denoted in bytes. The displayed artifact size denotes the raw uploaded artifact size (the sum of all the individual files uploaded during the workflow run for the artifact), not the compressed size. When you click to download an artifact from the summary page, a compressed zip is created with all the contents of the artifact and the size of the zip that you download may differ significantly from the displayed size. Billing is based on the raw uploaded size and not the size of the zip.
|
||||
|
||||
# Limitations
|
||||
|
||||
### Zipped Artifact Downloads
|
||||
@ -233,26 +257,11 @@ If file permissions and case sensitivity are required, you can `tar` all of your
|
||||
name: my-artifact
|
||||
path: my_files.tar
|
||||
```
|
||||
### Too many uploads resulting in 429 responses
|
||||
|
||||
### Retention Period
|
||||
|
||||
Artifacts are retained for 90 days by default. You can specify a shorter retention period:
|
||||
|
||||
```yaml
|
||||
- name: 'Create a file'
|
||||
run: echo "I won't live long" > my_file.txt
|
||||
|
||||
- name: 'Upload Artifact'
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: my-artifact
|
||||
path: my_file.txt
|
||||
retention-days: 5
|
||||
|
||||
```
|
||||
|
||||
The retention period must be between 1 and 90 inclusive.
|
||||
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`.
|
||||
|
||||
To reduce the chance of this happening, you can reduce the number of HTTP calls made during artifact upload by zipping or archiving the contents of your artifact before an upload starts. As an example, imagine an artifact with 1000 files (each 10 Kb in size). Without any modification, there would be around 1000 HTTP calls made to upload the artifact. If you zip or archive the artifact beforehand, the number of HTTP calls can be dropped to single digit territory. Measures like this will significantly speed up your upload and prevent uploads from being throttled or in some cases fail.
|
||||
|
||||
## Additional Documentation
|
||||
|
||||
|
3333
dist/index.js
vendored
3333
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
3421
package-lock.json
generated
3421
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -29,7 +29,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/actions/upload-artifact#readme",
|
||||
"dependencies": {
|
||||
"@actions/artifact": "^0.4.0",
|
||||
"@actions/artifact": "^0.5.2",
|
||||
"@actions/core": "^1.2.6",
|
||||
"@actions/glob": "^0.1.0",
|
||||
"@actions/io": "^1.0.2"
|
||||
@ -41,10 +41,10 @@
|
||||
"@zeit/ncc": "^0.22.1",
|
||||
"concurrently": "^5.1.0",
|
||||
"eslint": "^7.4.0",
|
||||
"eslint-plugin-github": "^3.4.1",
|
||||
"eslint-plugin-github": "^4.1.1",
|
||||
"eslint-plugin-jest": "^23.8.2",
|
||||
"glob": "^7.1.6",
|
||||
"jest": "^26.1.0",
|
||||
"jest": "^26.6.3",
|
||||
"jest-circus": "^26.1.0",
|
||||
"prettier": "^2.0.4",
|
||||
"ts-jest": "^25.3.1",
|
||||
|
@ -31,11 +31,18 @@ async function run(): Promise<void> {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const s = searchResult.filesToUpload.length === 1 ? '' : 's'
|
||||
core.info(
|
||||
`With the provided path, there will be ${searchResult.filesToUpload.length} file(s) uploaded`
|
||||
`With the provided path, there will be ${searchResult.filesToUpload.length} file${s} uploaded`
|
||||
)
|
||||
core.debug(`Root artifact directory is ${searchResult.rootDirectory}`)
|
||||
|
||||
if (searchResult.filesToUpload.length > 10000) {
|
||||
core.warning(
|
||||
`There are over 10,000 files in this artifact, consider creating an archive before upload to improve the upload performance.`
|
||||
)
|
||||
}
|
||||
|
||||
const artifactClient = create()
|
||||
const options: UploadOptions = {
|
||||
continueOnError: false
|
||||
|
Reference in New Issue
Block a user