Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

shiipou
Copy link

@shiipou shiipou commented Jun 19, 2025

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, and the implementation change almost nothing in the code. So it won't break any part of the 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
name: Loop Over Artifact IDs

on: [push]

permissions:
  contents: write
  actions: write
  packages: write

jobs:
  create-artifacts:
    runs-on: ubuntu-latest
    steps:
      - name: Create and upload artifacts
        run: |
          mkdir -p artifact1 artifact2
          echo "Content1" > artifact1/file.txt
          echo "Content2.1" > artifact2/file1.txt
          echo "Content2.2" > artifact2/file2.txt
          echo "Content2.3" > artifact2/file3.txt
      - id: artifact-1
        name: Upload artifact 1
        uses: actions/upload-artifact@v4
        with:
          name: artifact1
          path: artifact1/*
      - id: artifact-2
        name: Upload artifact 2
        uses: actions/upload-artifact@v4
        with:
          name: artifact2
          path: artifact2/*
    outputs:
      artifact-1-id: ${{ steps.artifact-1.outputs.artifact-id }}
      artifact-2-id: ${{ steps.artifact-2.outputs.artifact-id }}

  process-artifacts:
    needs: create-artifacts
    runs-on: ubuntu-latest
    steps:
      - id: download-artifacts
        name: Download artifacts
        uses: shiipou/download-artifact@main
        with:
          artifact-ids: ${{ needs.create-artifacts.outputs.artifact-1-id }},${{ needs.create-artifacts.outputs.artifact-2-id }}
          path: artifacts/
          unzip: ${{ needs.create-artifacts.outputs.artifact-1-id }}
      - name: print artifacts
        run: ls -pAR artifacts/
      - name: unzip artifacts
        run: unzip artifacts/**/*.zip

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant