Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.

Report error if a file glob doesn't match anything #63

Merged
merged 1 commit into from
Mar 23, 2021

Conversation

eyal0
Copy link
Contributor

@eyal0 eyal0 commented Jan 5, 2021

This fixes #62

I didn't test this.

@eyal0 eyal0 force-pushed the patch-1 branch 2 times, most recently from 952108f to e8cc89d Compare January 6, 2021 00:01
@marvinpinto
Copy link
Owner

I think it might be reasonable to report that no files were found with the glob. I would prefer info instead of error though.

Could probably reduce that diff down to something like:

   const paths = await globby(files);
+  if (paths.length === 0) {
+    core.info(`Could not find any release assets to upload`);
+  }

How does this behave in situations where a repo does not specify files to upload? I'm theoretically on board with adding this but my maintenance here is limited and so I will need this to be as bullet proof as possible (with tests, etc).

If you don't have the time for that I totally understand 👍

@eyal0
Copy link
Contributor Author

eyal0 commented Jan 6, 2021

The code that you suggest, if there are no files to upload, will report that error (or info). That's not good.

The code as I wrote it would not report an error because, if there are no globs specified then we'll never enter the loop. This is a good behavior and consistent with other unix tools.

I based my PR on the behavior of bash CLI, which is that if a glob is specified but matches nothing, an error is reported. I think that people would expect that consistency with tools that they've already used.

Also, I think that info is insufficient because it's too easy to not notice those. It would be easy to accidentally make releases that have missing assets.

@Margen67

This comment has been minimized.

@eyal0
Copy link
Contributor Author

eyal0 commented Feb 13, 2021

BTW, are there instructions on how to use this repo in a fork? I know that this repo backs multiple different GitHub actions. How can I compile my own version and test this?

(It's not great that GitHub only allows one action per repo. If they didn't have that limitation, you could put all the actions into this one repo and save all the trouble in publishing.)

@marvinpinto
Copy link
Owner

Darn, I didn't realize what hitting the "merge branch" button did in GitHub. Could you rebase this again and remove my weirdo "Merge branch 'master' into patch-1" commit? I'll merge this as-is after that 👍

@eyal0
Copy link
Contributor Author

eyal0 commented Mar 23, 2021

Done.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uploading artifacts that don't exist doesn't cause an error
3 participants