Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Pilot Lvl 1
Message 1 of 5

feature request: download zip artefacts as .zip, not .zip.zip

Solved! Go to Solution.

After a action is finished I can download the produced artifacts from a popup menu in the upper right corner of the build log.

When it is a zip file it will show up as "a-file.zip" but after downloading it will show up as "a-file.zip.zip" on my disk and I need to unpack twice.

 

Can the download logic be changed so that zip files are not re-zipped?

 

Thanks!

Tom

4 Replies
Highlighted
GitHub Partner
Message 2 of 5

Re: feature request: download zip artefacts as .zip, not .zip.zip

Did you use the action actions/upload-artifact to upload artifacts in your workflow?

I tested and checked this with different OSs, all the downloaded artifacts were normal and shown as .zip, not .zip.zip .

If possible, can you share your repository with us, so that we can check your workflow configurations to analyze the root cause?

Highlighted
Pilot Lvl 1
Message 3 of 5

Re: feature request: download zip artefacts as .zip, not .zip.zip

Thanks for the quick reply BrightRan!

On this page there is a DclareForMPS.zip that downloads on my mac (safari 13.0.5) as DclareForMPS.zip.zip.

I used actions/upload-artifact@v1.

You will find whatever you need in the underlaying project.

Hope you can shed some light :-)

 

-Tom

Highlighted
Solution
GitHub Partner
Message 4 of 5

Re: feature request: download zip artefacts as .zip, not .zip.zip

When using the action actions/upload-artifact to upload artifacts, the action will automatically package the files in the specific path (can be a directory path or a file path) as a ZIP and names the ZIP with the specific name (artifact name).

I checked your workflow configurations, and found:

      - name: "publish action-artifact zip"
        uses: actions/upload-artifact@v1
        with:
          name: DclareForMPS.zip
          path: build/artifacts/DclareForMPS/DclareForMPS.zip

There are 2 questions in your workflow about this:

1) You have set the artifact name as DclareForMPS.zip, so the artifact will be zipped as DclareForMPS.zip.zip.

2) Before upload the artifact, you have zipped the files as a ZIP in the specific path, that means the uploaded file itself is already a ZIP file. This is the root cause that you must unzip your artifact twice.

After executing the action actions/upload-artifact, the structure of your artifact will like below:

DclareForMPS.zip.zip
┕ DclareForMPS.zip

To avoid this misunderstanding, I recommend you take the following updates:

1) Set the artifact name as DclareForMPS, not DclareForMPS.zip.

2) Before upload the artifact, directly copy the folders or files you want to upload as artifact into the specific path (build/artifacts/DclareForMPS), instead of zipping them at first.

3) After above two updates, the step configuration should look like below:

      - name: "publish action-artifact zip"
        uses: actions/upload-artifact@v1
        with:
          name: DclareForMPS
          path: build/artifacts/DclareForMPS   

 

Highlighted
Pilot Lvl 1
Message 5 of 5

Re: feature request: download zip artefacts as .zip, not .zip.zip

That explains a lot! Thanks.

 

I think I was a bit misled by the term artifact which sounds more like a file then a dir to me, but that is bias ;-).

This gives me the workaround I needed.

 

I would still like to propose this as a feature request though:

   - do not zip an already zipped file if it is the only artifact

 

Thanks again!