-
Notifications
You must be signed in to change notification settings - Fork 541
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
Is it possible to not fail the workflow if the artifact doesn't exist? #42
Comments
Currently it is not possible to not fail the workflow if no artifact is found Some customization is on the way for Perhaps a similar option could prove useful for |
Any updates on this issue? |
I was having the same issue. After reviewing the method used, I can see that if you don't specific a name on the download, it will attempt to create the directories regardless.
This worked for me as a work around. |
@benjamincharity maybe use |
I called this out in the original edit. There are multiple ways to functionally unblock ourselves to get around this, but from what I've seen each method will still mark our workflow as failed in the PR and primary repo badge. So any contributor or consumer needs to actually go see if our build is really failing or if it is just one optional step that is failing. |
@benjamincharity you should check on this again. i dd a quick playground to replicate the behavior you described. i used PS: |
@jkowalleck thanks for calling this out. From your test it sure does looks like you are correct. I'll be happy to be wrong on this 😄 I will give it a test as soon as I can. Thanks! |
Hi, we fixed it in if statement. We check for existence of coverage file:
hope it helps someone, we made it defensive since its a pipeline for multiple apps. Some are mature and some not :) |
@konradpabjan would you accept a PR that adds the |
Actually not sure it solves anything because we're talking about download here. How would you check that the file in the artifact exists if it isn't downloaded yet ? Did someone find a workaround ?
This would be the best solution imho. I'll probably make an action myself returning true or false as an output if there are artifacts. I can't think of another way to do it for now |
Stumbled across this need and found no way of checking if some artifact exists. So created a new action: https://github.com/marketplace/actions/check-artifact-existence You can add a new step that is going to expose and output denoting if an artifact exists or not by the given artifact name: uses: actions/xSAVIKx/artifact-exists-action@v0
id: check_coverage_artifact
with:
name: 'coverage-artifact' Then you can use |
Just don't use this action and call
|
In my case, I was able to do the following. - id: check-artifact-exist
run: |
url="https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/runs/${run-id}/artifacts"
echo "artifact-name=$(curl -fsSL "$url" | jq -r '.artifacts[0].name')" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v4
if:
${{ steps.check-artifact-exist.outputs.artifact-name ==
'xxx' }} |
We've been having intermittent issues uploading our coverage reports from our GitHub action. These issues are displayed as 403s which cause really, really long jobs. In order for this to not block steps that come after test coverage, we are moving the coverage upload to a final step after all other.
The issue we have is that coverage is not always generated. In those cases, download artifact fails that final step and the entire workflow is marked as failed.
Our flow:
a) check if any packages have changes since last run
b) if changed, run tests
c) upload coverage (if no test are run, no coverage exists but the uploader does gracefully exit)
d) all other steps
e) attempt to upload coverage (FAIL if no coverage is found)
Is there a way to gracefully fail if the artifact hasn't been uploaded since in some cases this is not a failure from our standpoint?
Ninja edit: I did see the option
continue-on-error
, but the overall workflow is still shown with the red 'x' so at a glance it appears our entire release is failing to consumers.The text was updated successfully, but these errors were encountered: