Skip to content

fix: support non-zipped artifacts in gh run download#13524

Open
ShahabAhmed01 wants to merge 1 commit into
cli:trunkfrom
ShahabAhmed01:trunk
Open

fix: support non-zipped artifacts in gh run download#13524
ShahabAhmed01 wants to merge 1 commit into
cli:trunkfrom
ShahabAhmed01:trunk

Conversation

@ShahabAhmed01
Copy link
Copy Markdown

Fixes #13012

GitHub Actions now supports uploading artifacts with archive: false, but the CLI always attempts to unzip artifacts regardless of their format. This causes a "not a valid zip file" error when downloading non-zipped artifacts.

Root Cause
The downloadArtifact function in http.go always treats downloaded artifacts as zip files and attempts to extract them without checking the Content-Type header.

Fix

  • Check Content-Type header to detect if artifact is a zip file
  • If Content-Type is not application/zip or application/x-zip-compressed, write the file directly to destination without attempting to unzip
  • Pass artifact name through the download pipeline to ensure correct filename for non-zipped artifacts

Changes

  • Modified platform interface to accept artifact name parameter
  • Updated downloadArtifact to check Content-Type and handle non-zipped artifacts
  • Updated test to match new signature

Testing

  • Existing test updated to match new interface signature
  • Manual testing with non-zipped artifacts would verify the fix

Check Content-Type header to detect non-zipped artifacts and write them
directly to destination without attempting to unzip. This fixes the issue
where GitHub Actions now supports uploading artifacts with archive: false.

Fixes cli#13012
@ShahabAhmed01 ShahabAhmed01 requested a review from a team as a code owner May 26, 2026 13:41
@ShahabAhmed01 ShahabAhmed01 requested a review from BagToad May 26, 2026 13:41
@github-actions github-actions Bot added external pull request originating outside of the CLI core team needs-triage needs to be reviewed labels May 26, 2026
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 needs-triage needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't Download Non-Zipped Artifacts

1 participant