actions / download-artifact

MIT License
1.41k stars 480 forks source link

Feature request: Wait/block until an artifact is actually available #25

Open smuuf opened 4 years ago

smuuf commented 4 years ago

The idea is that this would introduce better options for parallelization inside a workflow.

If I understand right, currently only jobs can need (wait) for other jobs to finish.

If job B expects an artifact from job A, it must wait for job A to finish completely.

If job B was able to wait (block) for some artifact from job A, it would allow us to run both jobs at the same time and do their stuff (for example build Docker images and prepare other stuff, which can take quite a lot of time) simultaneously. Then, job B could simply wait until job A uploads expected artifact - and then job B could continue, being sure that it has everything it needs.

Obviously some kind of timeout configuration should be possible (mandatory?), after which the step would fail, if the expected artifact never appeared.

I'm just wondering if such idea makes sense to anyone else, too? 🤔 Or is there already some way how to do this kind of thing?

vaind commented 2 years ago

At the very simplest, I imagine this could be implemented by waiting for the job to finish - poll the API and wait for the target job status to change to one of the final states (success/failure): https://docs.github.com/en/rest/reference/actions#list-jobs-for-a-workflow-run. This would introduce new settings:

vaind commented 2 years ago

For anyone interested, I've taken a stab at this (and am starting to use it in GA workflows) - feel free to have a look at #139 and test the changes from my repository (use commit hash instead of a version)

vaind commented 1 month ago

I've added another PR for this after the previous one grew outdated: #347