Skip to content

fix(run download): support non-zipped artifacts#13636

Open
AruneshDwivedi wants to merge 1 commit into
cli:trunkfrom
AruneshDwivedi:fix/non-zipped-artifacts
Open

fix(run download): support non-zipped artifacts#13636
AruneshDwivedi wants to merge 1 commit into
cli:trunkfrom
AruneshDwivedi:fix/non-zipped-artifacts

Conversation

@AruneshDwivedi

Copy link
Copy Markdown

Summary

Fixes #13012

Artifacts uploaded with archive: false are returned with Content-Type: application/octet-stream instead of application/zip. The gh run download command previously tried to unzip all artifacts, causing zip: not a valid zip file errors for non-zipped artifacts.

Changes

  • Check Content-Type response header before attempting zip extraction
  • Non-zipped artifacts are saved directly using the artifact name
  • Added DownloadWithName method to the platform interface
  • Added test for non-zipped artifact download

Testing

  • Added Test_Download_NonZip test that mocks a non-zipped response and verifies the file is saved directly

Artifacts uploaded with archive: false are returned with
Content-Type application/octet-stream instead of application/zip.
The download command previously tried to unzip all artifacts,
causing 'zip: not a valid zip file' errors.

Fix: check Content-Type header before attempting zip extraction.
Non-zipped artifacts are saved directly using the artifact name.

Fixes cli#13012

Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team ready-for-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't Download Non-Zipped Artifacts

2 participants