-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: add support for unzip argument in downloadArtifact #2095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ue when not needed
|
I've rebased the PR on the latest commit of main. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for an unzip argument in the downloadArtifact functionality, allowing users to download artifacts as zip files without automatic extraction. This addresses a frequently requested feature while maintaining backward compatibility (defaults to unzip: true).
Key changes:
- Added
unzipandartifactNameoptions to control whether artifacts are automatically extracted - Created
StreamExtractOptionsinterface to encapsulate streaming/extraction parameters - Updated both public and internal download functions to support the new options
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 14 comments.
| File | Description |
|---|---|
packages/artifact/src/internal/shared/interfaces.ts |
Added unzip and artifactName properties to DownloadArtifactOptions and created new StreamExtractOptions interface |
packages/artifact/src/internal/download/download-artifact.ts |
Modified stream extraction logic to conditionally unzip or save as .zip file based on options; updated function signatures to accept new options |
packages/artifact/__tests__/download-artifact.test.ts |
Added test cases for keeping artifacts zipped in both public and internal download scenarios |
Comments suppressed due to low confidence (1)
packages/artifact/src/internal/download/download-artifact.ts:27
- Unused imports basename, join.
import { basename, join } from 'path'
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR just add the possibility to filter what we want to unzip or not when downloading artifacts.
This feature was asked by so many people. I choose to focus on simplicity on this implementation and change almost nothing in the code, so it won't break any part of the existing toolkit.
Here a simple example that show how it work : https://github.com/shiipou/download-artifact/blob/main/.github/workflows/test.yml
You can also try it with this workflow :
Workflow