Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download shouldn't break if if_no_artifact_found is set to !fail #305

Open
mkarasik opened this issue Aug 26, 2024 · 1 comment
Open

Download shouldn't break if if_no_artifact_found is set to !fail #305

mkarasik opened this issue Aug 26, 2024 · 1 comment

Comments

@mkarasik
Copy link

mkarasik commented Aug 26, 2024

I have a multiple artifacts in my run, and one of them is expired. However the download loop stops regardless of the flag.

https://github.com/dawidd6/action-download-artifact/blob/master/main.js#L257

    } catch (error) {
      if (error.message.startsWith("Artifact has expired")) {
          return setExitMessage(ifNoArtifactFound, "no downloadable artifacts found (expired)")
      } else {
          throw new Error(error.message)
      }

Warn and ignore should not break the loop.

@mkarasik
Copy link
Author

I patched in my branch as below

          } catch (error) {
                if (error.message.startsWith("Artifact has expired")) {
                    setExitMessage(ifNoArtifactFound, "no downloadable artifacts found (expired)")
                    if (ifNoArtifactFound === "fail")
                        return
                    else
                        continue
                } else {
                    throw new Error(error.message)
                }
            }

but it doesn't look like the correct code. I wonder if the artifact status should be checked and logged before the download loop started.
Any comments on this?

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

No branches or pull requests

1 participant