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 <[email protected]>

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

Co-authored-by: Copilot <[email protected]>

* 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 <[email protected]>
This commit is contained in:
Daniel Kennedy
2026-01-30 12:18:38 -05:00
committed by GitHub
co-authored by Copilot
parent ffae274475
commit 975fcbd402
6 changed files with 436 additions and 39 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@actions/artifact",
"version": "6.0.0",
"version": "6.1.0",
"preview": true,
"description": "Actions artifact lib",
"keywords": [