Compare commits

...

14 Commits

Author SHA1 Message Date
ee69f02b3d Bump @actions/artifact to version 0.5.1 (#189)
* Bump @actions/artifact to version 0.5.1

* Update license versions
2021-04-06 16:47:26 -04:00
bcd44ad93d Bump y18n from 4.0.0 to 4.0.1 (#186)
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-06 14:57:20 -04:00
ea3d524381 Merge pull request #173 from yacaovsnc/main
Display a warning if user tries to upload over 10000 files
2021-02-08 15:48:10 -05:00
e95d1b9c8d update index.js 2021-02-08 15:41:35 -05:00
0fbc4b771a Display a warning if user tries to upload over 10000 files 2021-02-08 15:09:20 -05:00
a1af2e8f43 Add on: pull_request trigger to CodeQL workflow (#165)
From February 2021, in order to provide feedback on pull requests, Code Scanning workflows must be configured with both `push` and `pull_request` triggers. This is because Code Scanning compares the results from a pull request against the results for the base branch to tell you only what has changed between the two.

Early in the beta period we supported displaying results on pull requests for workflows with only `push` triggers, but have discontinued support as this proved to be less robust.

See https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#scanning-pull-requests for more information on how best to configure your Code Scanning workflows.
2021-01-15 12:19:21 +01:00
a4f98af3fa Update README.md 2021-01-07 18:56:21 +01:00
16b8b2b2e7 Update where does the upload go section (#162) 2021-01-05 16:00:51 +01:00
e448a9b857 Add retries to all HTTP calls + resolve dependabot alerts (#160)
* Bump @actions/artifact to version 0.5.0

* Resolve dependabot alert for node-notifier

* Resolve dependabot alert for node-fetch

* Bump artifact.dep.yml

* Update http-client.dep.yml
2021-01-04 15:48:10 +01:00
e6bd6b7749 Replace "file(s)" with "file" or "files" (#159) 2021-01-04 11:24:12 +01:00
1fd4c858f9 Merge pull request #152 from actions/joshmgross/fix-codeowners
Fix CODEOWNERS team name
2020-12-07 14:24:45 -05:00
a2af908e3a Fix CODEOWNERS team name 2020-12-07 13:36:14 -05:00
928d1a16d9 Create CODEOWNERS (#149) 2020-11-25 15:24:41 -05:00
e4a7ffadfc Update README with more retention documentation 2020-11-17 12:57:17 -05:00
9 changed files with 3378 additions and 3418 deletions

1
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1 @@
* @actions/artifacts-actions

View File

@ -2,6 +2,7 @@ name: "Code scanning - action"
on:
push:
pull_request:
paths-ignore:
- '**.md'
schedule:

View File

@ -1,6 +1,6 @@
---
name: "@actions/artifact"
version: 0.4.0
version: 0.5.1
type: npm
summary:
homepage:

View File

@ -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

View File

@ -199,12 +199,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 +256,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

3330
dist/index.js vendored

File diff suppressed because it is too large Load Diff

3397
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@
},
"homepage": "https://github.com/actions/upload-artifact#readme",
"dependencies": {
"@actions/artifact": "^0.4.0",
"@actions/artifact": "^0.5.1",
"@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",

View File

@ -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 create an archive before upload to improve the upload performance.`
)
}
const artifactClient = create()
const options: UploadOptions = {
continueOnError: false