-
Notifications
You must be signed in to change notification settings - Fork 757
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
List artifacts doesn't work during workflow run #53
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 To accomplish this, we need some lower level support to list/delete artifacts before the run is complete, see: |
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 |
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? |
It's also an issue when you want to launch another workflow (2) that would use an artifact created in the original workflow (1) run, but since (1) is still executing other steps or jobs, the artifact is not available in the API, although it's uploaded already. |
One /can/ technically just call the same internal APIs used by download-artifact but it's hacky and fragile, and the returned URLs only work with the authorization headers that only exist in the Actions context. It also doesn't give you an artifact ID that will be valid later when the artifacts show up in the REST API. You can see some code that does that here: https://github.com/mozilla/DeepSpeech/blob/a6bdf0ae3c190cbaf39dc4598cc87a55047e38fa/.github/actions/update-cache-index/main.js#L8-L37 I ended up giving up going down that path because I needed stable URLs for the artifacts. It also means that there's a more fundamental change that needs to happen in the way GitHub Actions implements artifacts internally to allow for this issue to be fixed. The internal API being queried is not the GitHub REST API, but rather an Azure Pipelines API, so I'm guessing there's some syncing of state between the two systems that only happens at predetermined times, such as workflow run completion. |
It'd be great if this could work better for using Environments to gate the publishing of a built artifact. We'd like for one stage to build the artifact, upload it, then a person manually tests the artifact, submits an approving review once they've tested, then the second job comes to publish the same artifact. If we can't access artifacts mid-job, this won't work at all. |
I'm also running into this issue in a release context. We trigger a Short of uploading the artifacts somewhere for re-use, I don't currently see how we can do this as they must be accessed in a separate workflow as it stands. |
@JacksonKearl I was trying to achieve the exact same setup. We are building VS Code extensions that run on MacOS, Windows and Linux. The release workflow is supposed to build a .vsix file in one job, pass it down to few other jobs running e2e tests, and a QA is supposed to manually verify the artefact, if all is ok the team would authorise a publishing environment that would upload the artefact to the store. I think Actions have some room for improvement for Jobs that include manual labour, as well as the artefacts in those cases should be available somehow before the workflow fully completes. |
This is impacting me while writing and testing a new workflow -- I want to verify that a new artifact uploading step is doing the right thing but I'm not ready to run the whole long workflow yet (and have not yet written the step that downloads and uses the artifacts). |
We would love to see this feature too. We build binaries, store them as artifacts, and then want to download them directly through the API. |
+1 it makes a tonne of sense to view artifacts immediately in the workflow and not wait for it to complete. For example we have a rollback step post deploy pending approval and our workflow never really ends, however we could have an e2e test fail and would like to view the artifacts even when the workflow is not completed. |
+1. Also have the same requirement to do some manual work before approving to deploy an artifact to an environment. Coming from Azure DevOps, I believe that this functionality was on that platform. |
+1 for deploying some artifacts when using other deployment. Now I have to sleep for few seconds to make this work. |
Is there any word about this being on the roadmap? I just stumbled upon this limitation yesterday after some head scratching why the list size was 0 after pushing artifacts for a good part of the day. Without this ability we're going to have to scrap the attempt to automate this specific process as it won't be possible without storing the artifacts with a 3rd party. |
There's also this thread in the community: May be a better place to get eyes on this issue instead of the action "issue" list. |
This really really super-duper annoying :( Coming from Azure DevOps this is a must and not acceptable at all. |
I also have the same issue . I have a requirement to use build artifact in release task , which is present currently in a separate job within same dispatch workflow. How do I achieve this , I am not sure. If anyone has any solution work around . pls Suggest |
@P9155522 download and upload artefact actions work between jobs. It is just an UI issue, but the actions can exchange artefacts between jobs. We have a setup where a windows machine would build some VS Cod extension and attach them then Mac Win and Linux will download them and run tests. |
+1 to this being a huge inconvenience. Coming from CircleCI, this is a reason I'd switch back. |
+1 How are we suppose to make some validation if we cannot access the artifacts before rejecting/approving deployment? |
As a workaround, my deployments are making release drafts and attach the artifacts for validation there. |
+1 Is somebody aware if github devs are working on this? |
+1 This is very useful in CircleCI. But actions does not support. |
does someone have a solution for this? 😭 |
lulz gg |
Disappointed that GitHub has not solved this yet. I think a workflow to deploy an artifact that can be used during a CI build to do an initial deploy and re-used to deploy to further environments makes total sense. To get around this I have had to use an IF statement to use the correct Action based upon the context. This works but it painful:
|
This is a joke that its still not fixed, I'm going back to Azure DevOps |
+1 to this, just spent the last week building out a pipeline, and the last thing I had to do was delete the artifact from a terraform plan and .terraform folder. Now that it's not working, I feel like it was a waste of my time. |
I got mad that I this was still a problem, so I just made my own workflow to tackle this. I am using the gh CLI to do the dirty work, but you could use curl or something similar. In my case I am actually deleting the artifact once the workflow that creates it is complete, but it does require to list it first. This may not work for most people since they likely need it during the previous run, but at least this might help someone!
|
it is a shame for not fixing this in almost 3 years. |
Is anyone at GitHub listening? This is a sorely needed feature. |
@zwass Lul they're all working "remotely" now wink, probably push a feature every decade or so. |
Might be barking up the wrong tree here, but @TingluoHuang can you help make this issue more visible? |
…he job is running Instead we need to use the download action, this cannot be done in PowerShell unless the whole workflow has finished. See issue here: actions/upload-artifact#53
@DPatrickBoyd I was going to do something similar, but then realized a workflow can only be triggered by |
…ulacrum Publish docs as github artifacts during CI Discussed here: https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Building.20docs.20for.20PR.20CI The goal is to make docs available for download after CI runs on PRs, for easy review of API changes. Notes: - Currently this only captures library documentation (`core`, `alloc`, `std`, `test`, `proc_macro`) - You can't see artifacts until the entire workflow run has completed actions/upload-artifact#53 - There is currently a generic file name `ci-artifacts`. No way to customize this based on contained files unfortunately actions/upload-artifact#349 You can find the results at the bottom of the CI "summary" page: <img width="379" alt="image" src="https://github.com/rust-lang/rust/assets/13724985/d3748e59-242c-40f8-9f54-82177b9b481b">
Publish docs as github artifacts during CI Discussed here: https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Building.20docs.20for.20PR.20CI The goal is to make docs available for download after CI runs on PRs, for easy review of API changes. Notes: - Currently this only captures library documentation (`core`, `alloc`, `std`, `test`, `proc_macro`) - You can't see artifacts until the entire workflow run has completed actions/upload-artifact#53 - There is currently a generic file name `ci-artifacts`. No way to customize this based on contained files unfortunately actions/upload-artifact#349 You can find the results at the bottom of the CI "summary" page: <img width="379" alt="image" src="https://github.com/rust-lang/rust/assets/13724985/d3748e59-242c-40f8-9f54-82177b9b481b">
@nmattia it is indeed a bit annoying to debug the workflows when they are only triggered in main. It is possible to test in a fork as a bit of a workaround. Here is an example of how I implemented it for systemds: |
+1 |
@konradpabjan is there any update here? I am just encountering this problem for microsoft/netperf where one repo is trying to consume the artifacts of another, but it doesn't work if the run is still on going. |
+1 |
1 similar comment
+1 |
This is insane. Of course you would want to pass artifacts between jobs. We have a sequence of jobs that run on different runners for perfectly valid reasons and the only realistic solution is to use S3 or similar. We can split the workflow and work around it but why is that still a solution when years have passed since this was first raised? |
Workaround for this if someone does not want to use external cloud storage, would be to create temporary Gtihub Repo, to store the files, download those in another workflow and delete the repo. So that could be Steps to create and push to new Private Repo in Workflow A
and that could be the Steps to download from the Repo and delete it in workflow B
|
Since v4 is now available and "artifacts are [now] immediately available in the UI and REST API" (ref), is this still an issue? |
Yup! Closing this out after ages 🙃 Long time coming but it's finally out! v4 has officially released today which brings lots of improvements: https://github.blog/changelog/2023-12-14-github-actions-artifacts-v4-is-now-generally-available/ With it, the limitation that APIs don't work until a run is fully complete. Now after upload and artifact id is immediately available and you can use any of the APIs to Recommend switching to v4 as soon as possible! v1-v3 artifact still have these limitations |
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 byactions/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?
The text was updated successfully, but these errors were encountered: