Upload-artifact: List artifacts doesn't work during workflow run

Created on 11 Feb 2020  路  4Comments  路  Source: actions/upload-artifact

I tried to retrieve the list of artifacts in a second job using GET /repos/:owner/:repo/actions/runs/:run_id/artifacts after uploading some artifacts by actions/upload-artifact@v1 in the first job, but the artifacts won't show up. The API call will always return { "total_count": 0, "artifacts": [ ] }.
I have the second job depends on the first job.

Is there a solution to this?

Most helpful comment

Both listing an deleting an artifact with the artifacts API only works after a run is complete so the APIs defined in https://developer.github.com/v3/actions/artifacts/ won't work for your scenario. This is largely due to the fact that we don't mark an artifact as complete until the end of the run.

To accomplish this, we need some lower level support to list/delete artifacts before the run is complete, see:
https://github.com/actions/toolkit/issues/380
https://github.com/actions/toolkit/issues/379

All 4 comments

Same for me. I tried to create an action that would delete an artifact created during the run. But artifacts aren't listed until after the run is complete.

Both listing an deleting an artifact with the artifacts API only works after a run is complete so the APIs defined in https://developer.github.com/v3/actions/artifacts/ won't work for your scenario. This is largely due to the fact that we don't mark an artifact as complete until the end of the run.

To accomplish this, we need some lower level support to list/delete artifacts before the run is complete, see:
https://github.com/actions/toolkit/issues/380
https://github.com/actions/toolkit/issues/379

This may not be relevant, but is this the same reason artifacts aren't posted on the UI until the entire workflow is complete?

What I don't understand is why artifacts can be downloaded by subsequent jobs, but not through other means. Is there a reason not to mark them complete after each job?

I have the same issue. I'm publishing test failure reports for matrix entries. It's pretty annoying that I can't view the test reports until the workflow is completed. What is the reason for not marking artifacts as complete?

Was this page helpful?
0 / 5 - 0 ratings