Commit Graph
135 Commits
Author SHA1 Message Date
Daniel KennedyandCopilot 471c2154b5 Artifact download: don't unzip non-zip artifacts (#2253)
* Download artifact: don't extract the downloaded file if the content-type isn't a zip

* Remove unused `import`

* Add support for specifying whether to skip decompressing

* Prevent path traversal attacks

* Fix indenting

* Update packages/artifact/__tests__/download-artifact.test.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Parse the mime type out of the content-type header

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix some linting issues

* Swap `zip` for `application/zip-compressed`

* Test: negative check for malicious paths

* Increase the timeout on one of the tests

* Check the URL path for `.zip` to see if we can auto-decompress

* Fix linting issue

* Bump the package version and add release notes

* Remove `launch.json`

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-30 12:18:38 -05:00
Daniel Kennedy 0df0288961 @actions/artifact: convert to an ESM module (#2266)
* `@actions/artifact`: convert to an ESM module

* Update the package-lock.json

* Undo the GHES ignores

* Fix the reference to `@actions/http-client` in the lock file

* Bump `@actions/core` to `3.0.0`

* Remove `jest.config.cjs`

* Import `OctoKitOptions` from `@octokit/core/types`

* Pull the package version from `package.json`

* Workaround getting the package version for the user-agent

* Fix the `archiver` import

* Fix linting
2026-01-29 09:52:09 -05:00
Austen Stone 0ffbac0478 linting 2025-10-22 11:44:21 -04:00
Austen Stone a69f5c7f0c fix: resolve critical pagination bugs and add comprehensive testing
- Fix off-by-one error in pagination loop (< to <=) that prevented fetching last page
- Add Math.ceil() to maxNumberOfPages calculation for proper limit handling
- Replace hardcoded 2000 limit with configurable getMaxArtifactListCount()
- Add pagination test for multi-page artifact listing
- Add environment variable test for ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT
- Add comprehensive test coverage for getMaxArtifactListCount() function

Fixes compound bug where pagination and limit logic capped results at 900 artifacts instead of intended 1000.
2025-10-21 09:22:11 -04:00
Salman Muin Kayser Chishti 6c4051f635 Merge remote-tracking branch 'origin/main' into salmanmkc/node24 2025-10-15 16:41:54 +01:00
Daniel Kennedy 9ade3233e3 fix: only mock the cpus() function on the os module instead of the whole module 2025-10-15 16:26:39 +01:00
Daniel Kennedy c615b29a88 Fix linting 2025-09-25 09:26:13 -04:00
Daniel Kennedy 57706d3720 Test: add a timeout test for downloading chunks from the stream 2025-09-25 09:11:38 -04:00
Daniel Kennedy 85609d04f7 fix: only mock the cpus() function on the os module instead of the whole module 2025-09-24 20:01:53 -04:00
Salman Muin Kayser Chishti 11c03e66c9 Update test to use mock 2025-08-06 12:49:50 +01:00
Salman Chishti 9cbe12d3a4 Merge pull request #1982 from actions/salmanmkc/obfuscate-sas
Remove logging of any SAS tokens in Actions/Cache and Actions/Artifact
2025-03-17 11:47:29 +00:00
Salman Chishti 1ad7546f62 add encoding back with extra tests 2025-03-14 06:38:57 -07:00
Salman Chishti 645586ea7c fix tests 2025-03-14 04:28:22 -07:00
Salman Chishti a16f230892 PR feedback, back to simplified approach, no export on client as well 2025-03-13 04:23:45 -07:00
Salman Chishti c01a63223d Mask different situations, malformed URL, encoded, decoded, raw signatures, nested parameters, and moved to a utility file 2025-03-12 03:17:35 -07:00
Salman Chishti 2a461120c5 masks the whole URL, update tests 2025-03-10 06:47:52 -07:00
Salman Chishti 5040e42c6c Instead of using utility method in core lib, use method in both twirp clients 2025-03-07 06:01:25 -08:00
Salman Chishti d4179a3792 Add secret and signature masking for cache and artifact packages 2025-03-06 14:25:32 -08:00
Ryan Ghadimi 009c836f4c Update proto artifact interface, retrieve artifact digests, return indicator of mismatch failure 2025-03-05 11:29:44 +00:00
Yang Cao 10daf55e23 Default upload artifacts concurrency to 5 2025-02-20 17:03:29 +00:00
Yang Cao 254e08bbb5 Rename the prefix to be more specific 2025-01-08 20:32:45 +00:00
Yang Cao 11b17a3847 Concurrency has a min of 1 2025-01-08 18:14:04 +00:00
Yang Cao f001ee669d Make concurrency change opt-in, but can only go lower 2025-01-08 18:11:38 +00:00
Yang Cao 335ec19f38 Set default concurrency to 10 and make timeout configurable 2025-01-08 16:19:09 +00:00
Brian DeHamer a1ba4fd935 return artifact digest on upload
Signed-off-by: Brian DeHamer <bdehamer@github.com>
2024-12-06 14:27:46 -08:00
Rob Herley 0e9da186e3 properly resolve relative symlinks 2024-10-08 12:35:48 -04:00
Rob Herley 815e4a7df6 / 2024-09-20 17:52:14 -04:00
Rob Herley fe7a4cd568 fix assertion 2024-09-20 17:45:55 -04:00
Rob Herley dc351c35a6 fix regression, auto readlink on symlinks again 2024-09-20 17:23:43 -04:00
Rob Herley 27951a351a fix chunk timeout + update tests 2024-07-23 21:57:39 -04:00
Rob Herley 8c7a920210 allow localhost hostnames for artifact checks 2024-07-03 16:55:53 +00:00
bethanyj28 9b0906f349 lint 2024-04-23 16:10:57 -04:00
bethanyj28 c8709a8e12 lint 2024-04-23 16:06:02 -04:00
bethanyj28 f850f97534 use latest unzip-stream 2024-04-23 15:54:54 -04:00
Rob Herley 774e7d6589 artifact client: retry on non-JSON response 2024-04-19 14:03:47 +00:00
Vallie Joseph a7091c8dad replacing writeFile with writeFileSync 2024-04-15 16:57:28 +00:00
Vallie Joseph 318640778e replacing writeFile with writeFileSync 2024-04-15 16:51:30 +00:00
Vallie Joseph 8d1ee1b614 correcting imports 2024-04-15 16:49:47 +00:00
Vallie Joseph aa47e72426 cleaning up tests 2024-04-15 16:32:31 +00:00
Vallie Joseph be66121509 . 2024-04-15 15:24:57 +00:00
Vallie Joseph 598f9f4b84 replacing timeout 2024-04-09 20:51:12 +00:00
Vallie Joseph b6ba78eb47 updating timeout 2024-04-09 19:24:52 +00:00
Vallie Joseph e455efe4f9 . 2024-04-09 19:01:54 +00:00
Vallie Joseph e856ad08b8 updating test 2024-04-09 18:52:19 +00:00
Vallie Joseph a9276099d3 updating tests 2024-04-09 18:21:41 +00:00
Vallie Joseph ae1355a62d upgrading archiver package along with chunk timeout 2024-04-09 18:02:48 +00:00
bethanyj28 16c885c1b1 add a comment 2024-02-23 15:33:24 -05:00
bethanyj28 32d54cd56e re-add noop logs and format + lint 2024-02-23 13:46:22 -05:00
bethanyj28 a50f629b31 update test case and handling 2024-02-23 13:41:40 -05:00
bethanyj28 d46fe375bc attempt with comparing index 2024-02-23 11:59:36 -05:00