upload-artifact icon indicating copy to clipboard operation
upload-artifact copied to clipboard

[docs] Warn about empty directories in artifacts

Open orensbruli opened this issue 2 years ago • 2 comments

What files would you like to change?

README.md

What are your suggested changes?

I think it would be worth mentioning the filtering of empty directories. https://github.com/actions/upload-artifact/blob/65d862660abb392b8c4a3d1195a2108db131dd05/src/search.ts#L99-L100 I think by default, if we add a path, we expect to see it in the artifact that is generated, even if it is empty, another way we tend to think that something went wrong with the configuration of the action. Since this is not the case, I think it would be good to let the user know that the lack of empty directories is the expected behavior.

orensbruli avatar Mar 18 '23 07:03 orensbruli

PR https://github.com/actions/upload-artifact/pull/393

orensbruli avatar Mar 18 '23 07:03 orensbruli

Personally, I'd like the code to be changed to include empty directories. IMO, it's an unexpected result.

For my use case, I have a folder assets/maps/user that is meant for users of my games to add their own custom maps to. I use a workflow to make a zip and upload this to itch.io.

Workaround 1: zip up the files/folders manually first and then use that zip file in upload-artifact with the compression level set to 0.

Workaround 2: add .gitkeep to the empty folders and set upload-artifact to include hidden files.

esotericpig avatar Jan 10 '25 22:01 esotericpig