Add new option to specify behavior if no files found - #104
Conversation
| path: | ||
| description: 'A file, directory or wildcard pattern that describes what to upload' | ||
| required: true | ||
| if-no-files-found: |
There was a problem hiding this comment.
My biggest question/concern is what should this input be? 🤔I really can't think of a good name so any ideas would be great. if-no-files-found sounds a little "mech" but I can't think of anything better
There was a problem hiding this comment.
I though about this a little bit more, if-empty or if-empty-artifact are some other options
There was a problem hiding this comment.
those all sound reasonable, or "if-missing"
There was a problem hiding this comment.
I think "ignore" would be clearer and more natural than "suppress" (from user's point of view they're ignoring a situation/condition, not suppressing an exception)
There was a problem hiding this comment.
I like ignore a lot more compared to suppress. Thanks for the suggestion 😃
There was a problem hiding this comment.
Sticking with if-no-files-found after some internal discussions. A wee bit verbose, but it's clear as to the intention
| /** | ||
| * Helper to get all the inputs for the action | ||
| */ | ||
| export function getInputs(): UploadInputs { |
There was a problem hiding this comment.
actions/checkout action has ALOT of available options and it has a input-helper file that is used get everything. I'm copying the same thing. In the future if there are more input options needed for things like retention, this will help out. I would also like to add an option to make searching via symlinks user-customizable, so another option would be needed for that as well.
* Add new option to specify behavior if no files found
* Add new option to specify behavior if no files found
Overview
Addresses #91 and #90
By default, if no files are found with the provided
pathinput, thev2version ofupload-artifactwith not fail and there will be a warning in the logs.There have been numerous requests for the action to fail or for no warning so I'm adding an extra input option that will allow users to control this. The new input is called
if-no-files-found(not too sure about this name though, any ideas will be appreciated). The available options includewarn(default),errorandignore. The default remains aswarnsince we don't want existing behavior to change.READMEupdate: 🎨 rendered 🖌Testing
Upload with default behavior
https://github.com/konradpabjan/artifact-test/runs/918666195?check_suite_focus=true#step:4:23
Upload with
warnhttps://github.com/konradpabjan/artifact-test/runs/918670916?check_suite_focus=true#step:4:23
Upload with
errorhttps://github.com/konradpabjan/artifact-test/runs/918715964#step:4:23
Upload with
ignorehttps://github.com/konradpabjan/artifact-test/runs/924130458?check_suite_focus=true#step:4:23
Upload with an option that is not available
https://github.com/konradpabjan/artifact-test/runs/918907180#step:4:15