1
0
Fork 0
Commit Graph

56 Commits (a920781ca9ff07aec4d7c339072c06960c5d2a8b)

Author SHA1 Message Date
Rob Herley 82474125c8
use sha256 instead of md5 for artifact v4 integrity hash 2023-10-16 16:20:24 +00:00
Bethany 3d652d3133
Merge pull request #1505 from actions/bethanyj28/upload-tests
Add tests for `upload-artifact.ts`
2023-08-24 09:29:01 -04:00
Rob Herley 9d756b2bc9
linter 2023-08-24 09:16:35 -04:00
Rob Herley 67c3b7a45c
add tests for download artifact 2023-08-23 23:18:03 -04:00
Bethany 3963c722d8 merge download changes and lint 2023-08-23 14:02:50 -07:00
Bethany 3b44a4cc23 prettier 2023-08-23 13:55:26 -07:00
Bethany 03a876f0a7 add tests for upload 2023-08-23 13:54:31 -07:00
Bethany 58858b5078 don't use non-null assertions 2023-08-09 17:48:53 -07:00
Bethany 188abfc20b implement feedback 2023-08-09 17:42:14 -07:00
Bethany 2f42c127c7 update tests 2023-08-09 13:20:06 -07:00
Bethany 4b219f79f3 Add tests for backend id fetch 2023-08-09 12:29:43 -07:00
Bethany 24da3e2d1c lint 2023-08-09 07:10:43 -07:00
Bethany c0684c5add prettier 2023-08-08 13:19:43 -07:00
Bethany e85cd96d85 tests and fix bug for retry 2023-08-08 12:49:05 -07:00
Bethany af1621025d wip 2023-08-07 16:26:07 -07:00
Bethany 6552cb9722 wip 2023-08-07 14:24:58 -07:00
Bethany efcab31d38 pass in http client to constructor 2023-08-07 08:43:39 -07:00
Bethany 4c6d88f93a Start writing tests 2023-08-04 13:00:58 -07:00
Konrad Pabjan 7da3ac6eda
[Artifacts] Name validation + zip specification creation (#1482)
* Artifact name validation + zip specification creation

* Fix linting issues

* Grammar fix

* Update test description
2023-08-04 09:53:42 -04:00
Konrad Pabjan c4f5ce2665
[Artifacts] Prepare for v2.0.0 of @actions/artifact (#1479)
* Prepare for v2.0.0 of @actions/artifact

* Run prettier

* temporary disable unused vars
2023-08-03 13:34:41 -04:00
Héctor Molinero Fernández 6c1f9eaae8
[Artifacts] Add more extensions to the gzip compression exception list (#1118)
* [Artifacts] Add more extensions to the gzip compression exception list

* [Artifacts] Test .zip extension

* Exempt .zstd files from compression
2023-01-11 15:19:28 -05:00
Rob Herley eb7ed88d77
Merge branch 'main' into robherley/artifact-digest 2022-05-19 11:45:42 -04:00
Brian Cristante aa676f3cc7
Update other packages to use http-client v2 (#1082)
We moved `@actions/http-client` to be part of the toolkit in https://github.com/actions/toolkit/pull/1062.  We also made some breaking changes to exported types and released v2.

The biggest change in terms of lines of code affected was to get rid of the `I-` prefix for interfaces since TypeScript doesn't follow this convention.

I bumped the patch version of all packages except for `tool-cache`, where I bumped the major version.  The rationale is explained in the release notes for that package.
2022-05-11 17:14:25 -04:00
Rob Herley 35e5aac523
actually use md5 not sha256 2022-05-05 10:32:09 -04:00
Rob Herley a3c696e88e
add md5 and use b64 for digest encodings 2022-05-05 09:26:38 -04:00
Rob Herley d5c547c19f
update crc header key 2022-04-27 22:22:35 +00:00
Rob Herley 9e285cc3fa
crc: update test header data 2022-04-26 23:21:31 +00:00
Rob Herley 3f95e2ea4f
crc: update headers & digest stream 2022-04-26 22:59:56 +00:00
Rob Herley fccc5ee6e6
crc: move tbl out of class, more tests 2022-04-26 17:31:17 +00:00
Rob Herley 3d61fe8000
add crc64 & tests 2022-04-26 17:13:40 +00:00
Rob Herley e3549a9c58
artifact: tests for stream digest util 2022-04-05 09:31:49 -04:00
Zoran Regvart 37f5a85219
fix: drop support for named pipes on Windows (#962)
Seems that folk are having issues with uploading 0-byte files from
Windows agents. This effectively removes the support for Windows for
uploading from named files that, due to `isFIFO` returning `false` on
Windows for named pipes created using MSYS2's `mkfifo` command, resorted
to checking if the file size is 0 - a common trait of named pipes.

See https://github.com/actions/upload-artifact/issues/281
2021-12-14 15:50:50 -05:00
Konrad Pabjan cdd4e107a6
[Artifacts] Exempt certain types of files from gzip compression (#956)
* Exempt certain types of files from gzip compression

* Fix lint issue
2021-12-06 16:47:44 -05:00
Konrad Pabjan 88062ec473
Check for newlines and carriage return in artifact paths and name (#951)
* Check for newlines and carriage return in artifact paths and name

* Fix linting issue

* Update comments

* Add comment about spacing

* Remove extra space
2021-12-01 16:31:37 -05:00
Zoran Regvart 7932c147a0
Support upload from named pipes (#748)
Named pipes report file size as 0, which leads to reading the whole
content into memory (0 is less than 64K). This adds additional check to
make sure that the passed in path is not a named pipe, and in that case
opts for the create-temp-file-to-gzip code path.

When running on GitHub Actions infrastructure on `windows` node, named
pipes can be created using `mkfifo` from MSYS2. In that case `fs.Stats`s
`isFIFO()` returns `false`, and not `true` as expected. This case is
detected by `process.platform` being `win32` and the passed file having
length of 0.

As a side note, when MSYS2's `mkfifo` is run, a pipe file is created:

```
prw-rw-rw- 1 User None  0 Mar 31 12:58 pipe
```

If `fs.stat` is invoked at this point `ENOENT` error will be thrown. As
soon as the pipe is written to, this pipe file is replaced by two same-
named files:

```
-rw-r--r-- 1 User None  0 Mar 31 13:00 pipe
-rw-r--r-- 1 User None  0 Mar 31 13:00 pipe
```

And at this point `fs.stat` `isFIFO()` returns `false`. Even though the
file acts as a named pipe.
2021-11-29 17:19:02 -05:00
Brian Cristante db21627995
Retry artifact uploads on HTTP 500 (#833)
* Retry on 500

* bump package version

* fix tests

* Remove spurious change

* fix another test

* Roll back package version
2021-06-04 17:09:30 -04:00
Thomas Boop 0d74e9080a
Re-enable the audit tools step and update dependencies (#815)
* update package versions

* run audit

* fix eslint config

* linter updates

* re-enable audit

* update timeouts test

* pass done into callback

* fix format
2021-05-21 09:19:40 -04:00
Konrad Pabjan c861dd8859
Retry all http calls for artifact upload and download (#675)
* Retry all http calls for artifact upload and download

* Extra debug information

* Fix lint

* Always read response body

* PR Feedback

* Change error message if patch call fails

* Add exponential backoff when retrying

* Rework tests and add diagnostic info if exception thrown

* Fix lint

* fix lint error for real this time

* PR cleanup

* 0.5.0 @actions/artifact release

* Display diagnostic info if non-retryable code is hit
2020-12-18 21:40:50 +01:00
Yang Cao 5be846b72d style change, refactor arg sequence 2020-12-04 09:41:00 -05:00
Yang Cao dc491a61ca pipeResponseToFile already throws when reading truncated stream 2020-12-04 09:19:58 -05:00
Yang Cao b55731c11b Fix styling 2020-12-03 10:33:10 -05:00
Yang Cao 6b83f0554a Adding retry when we received 200
If we received 200, we will attempt to download the stream. If the
stream is gzipped, gzip should throw an error when trying to decompress
the stream; or if the stream is truncated, the received bytes should be
different from the value set in content-length header.
2020-12-03 10:15:12 -05:00
Chris Sidi 520206f818 Retry artifact download when response stream is truncated 2020-12-03 10:12:44 -05:00
Chris Sidi ff4308098f
Remove spyon, use readable stream to test pipeResponseToFile (#651)
* Remove spyon, use readable stream to test pipeResponseToFile

* Check file contents
2020-11-30 12:12:12 -05:00
Thomas Boop 4f7fb6513a
swap to file commands (#587)
* swap to file commands

* swap to require
2020-09-30 15:46:54 +02:00
Yang Cao ace7a82469
Add an option to specify retention days for artifacts (#575)
* Add an option to specify retention days for artifacts

* Validate against settings exposed as env var to give early feedback

* Fix lint

* Add tests and addressing feedback

* Update packages/artifact/__tests__/upload.test.ts

Co-authored-by: Konrad Pabjan <konradpabjan@github.com>

* Update packages/artifact/README.md

Co-authored-by: Konrad Pabjan <konradpabjan@github.com>

* Update packages/artifact/src/internal/utils.ts

Co-authored-by: Konrad Pabjan <konradpabjan@github.com>

* Update packages/artifact/__tests__/util.test.ts

Co-authored-by: Konrad Pabjan <konradpabjan@github.com>

Co-authored-by: Konrad Pabjan <konradpabjan@github.com>
2020-09-18 11:30:00 -04:00
Konrad Pabjan b2cba168a2
Retry on 413 (#540) 2020-08-04 16:57:38 +02:00
Aiqiao Yan d2b2399bd2 React to feedback 2020-05-15 12:26:42 -04:00
Konrad Pabjan 0471ed4ad7
artifact header cleanup (#441)
* Update NPM packages for @actions/artifact

* Clarifications around headers

* Revert NPM updates

* Apply suggestions from code review

Co-authored-by: Josh Gross <joshmgross@github.com>

Co-authored-by: Josh Gross <joshmgross@github.com>
2020-05-12 17:48:36 +02:00
Konrad Pabjan 1688b117e1
E2E tests for the @actions/artifact package (#421)
* End-to-end artifact tests

* E2E tests for artifact package
2020-04-23 20:52:53 +02:00