Closed MkQtS closed 1 year ago
Two backslashes are due that being a string in YAML. It'll end up as one backslash when the YAML is parsed:
Thanks @joonas-fi for answering the first question, much appreciated.
@MkQtS to answer the second question, when no file is found, we just throw an error and exit early. You can see this here https://github.com/dsaltares/fetch-gh-release-asset/blob/master/index.ts#L150. We don't set a specific error code on outputs. I guess it would fall to whatever action error behaviour GH has. I think that's a non zero exit code, but it won't be a specific one.
The docs allow you to explicitly set an action to failed, but it doesn't let you set a specific numerical code either https://github.com/actions/toolkit/tree/main/packages/core#exit-codes.
This action assumes you know the file you're looking for and that it is certain or very likely to exist.
@MkQtS does this answer your question?
@joonas-fi, @dsaltares, thank you for your clear replies, I get it now.
First one is about regex. The example of regular expression in the README file is:
Two backslash were used there. But we just need one backslash to interpret in regex, two backslash actually means a backslash itself. However, as far as I know, we may need two backslash to interpret in Java, the first one is for Java interpreter.
If the regex used here is Java style and we need two backslash to interpret, I think it would be better if we add some tips in the README.
Another question is, there may be a case that no file in releases were matched, caused by typo or the target doesn't exist at all. I haven't used the project yet, does the project provide an error code as Outputs? (If so, we can use GitHub Action's
if
in the next step to handle such case.)Thanks.