actions / upload-artifact

MIT License
3.23k stars 721 forks source link

[bug] Explicitly listed path that starts with a dot is ignored. #618

Open ioquatix opened 1 month ago

ioquatix commented 1 month ago

What happened?

Explicitly referenced files, e.g. .coverage.db are not uploaded.

What did you expect to happen?

The file should be uploaded as it exists and is explicitly listed: https://github.com/socketry/protocol-http/commit/036101536b693f1569f9b139934d4946cda7120d

How can we reproduce it?

Explicitly listing a path that starts with a dot.

Anything else we need to know?

No response

What version of the action are you using?

v4

What are your runner environments?

linux

Are you on GitHub Enterprise Server? If so, what version?

No response

ioquatix commented 1 month ago

I understand the value of ignoring hidden files when using glob patterns, but ignoring a file which is explicitly listed with an error "Warning: No files were found with the provided path: .covered.db. No artifacts will be uploaded." is extremely confusing, and made me think something was wrong with my own software. Suggest the following:

ioquatix commented 1 month ago

It might also be a nice idea to document somewhere what hidden files are, e.g. are we talking about dot files, .gitignoreed files, or anything else?

abravalheri commented 1 month ago

I think I am also hitting this problem in https://github.com/abravalheri/validate-pyproject/actions/runs/11034259945/job/30647361576.

image

In this GHA step, I am making sure all files exist and that the directory to be uploaded is not empty:

https://github.com/abravalheri/validate-pyproject/compare/v0.20...v0.20.1

but even when they exist the upload-artifact action seems to be ignoring them.

I agree that is better to always cache files/directories that are explicitly listed, even if they are hidden, rather than requiring users to set more attributes.

markfickett commented 1 month ago

It would be great to log "Ignored hidden files .env, .bin/, and 9 others, use include-hidden-files: true if you want to include them.".