Upload-artifact: Upload should fail if the zipball would be empty and allow-empty-zipball is not true

Created on 22 Jan 2020  Â·  5Comments  Â·  Source: actions/upload-artifact

While it was my fault that my Github action started to make empty zipballs, I would have preferred to be alerted of my bug way earlier. Therefor I suggest we add an option allow-empty-zipball, and unless that is explicitly set to true, we let the upload fail if the zipball would turn out empty.

v2-preview

Most helpful comment

I think it would be better to make this an error instead of a warning. Is there a reason for wanting a job that doesn't act as expected to succeed?

All 5 comments

v2-preview was just released, more information here: https://github.com/actions/upload-artifact/issues/62

The behavior has changed pretty significantly. With v1 if you specified an empty directory, there would be an artifact created at the end that would be 0 bytes and no errors or warnings.

With v2-preview, if an empty directory is specified as part of the input, no artifact will be available at the end of the run and a warning will pop up to alert you that no files were found to upload.

image

A separate option to error out if no files are found seems pretty limited so I think a warning + no artifact is a good way of letting users know that they are in fact not uploading anything.

I think it would be better to make this an error instead of a warning. Is there a reason for wanting a job that doesn't act as expected to succeed?

v2 of artifact upload has been released and with it there are clear warnings if no files are found for upload. Your original problem stemmed from no awareness when an empty artifact was uploaded and I consider that to be fixed with v2.

I'm going to close this issue since the path not finding files is an indication of some user error and there is a clear warning now. If you still think that there should be an option to fail the upload if no files are found, I would open another issue here. Instead of allow-empty-zipball I would suggest something like fail-if-no-files-uploaded or something similar.

I would like the option of failing the run instead of posting a warning if the file specified is not found. Should I create a separate issue for it @konradpabjan ?

Sorry for the noise a minute ago. Yes, I think the "If you still think that…" sentence was meant as you should open a new issue.

Was this page helpful?
0 / 5 - 0 ratings