download-artifact
download-artifact copied to clipboard
[bug] Downloading artifact from previous run (specifying its `run-id`) does not work
What happened?
When specifying a run-id
parameter to download an artifact from a previous workflow run (within the same repository) downloads the corresponding artifact of the current run, not the specified one (see screenshot)
What did you expect to happen?
The artifact from the specified run-id
is being retrieved
How can we reproduce it?
Use the action twice. First time with a specific run-id
, the second time with the defaulted current run-id
, e.g.
- name: Download latest main artifact
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: base-build-artifacts
run-id: <previous run id>
- name: Download current PR artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: new-build-artifacts
Anything else we need to know?
No response
What version of the action are you using?
v4
What are your runner environments?
linux
Are you on GitHub Enterprise Server? If so, what version?
No response
@weinshec Not a member of the download-artifact
team, but I'm a bit confused: the IDs you marked in your screenshot are the workflow run ID and the artifact ID, respectively. Did you mean to say the IDs should be the same?
@croemheld, sorry for the confusion. Let me try to elaborate...
What the screenshot shows are 2 (consecutive) steps in my workflow that each attempt to download a (different) artifact
- The first one (titled: "Download latest main artifact") tries to download an artifact from the last time this workflow ran for a push-to-main event, hence I specify a concrete
run-id
from which the artifact should be downloaded (7840389011).- name: Download latest main artifact uses: actions/download-artifact@v4 with: name: build-artifacts path: base-build-artifacts run-id: 7840389011
- The second step (titled: "Download current PR artifact") tries to download an artifact from the current run (7885661760), hence using the default run-id
- name: Download current PR artifacts uses: actions/download-artifact@v4 with: name: build-artifacts path: base-build-artifacts # no run-id specified here (defaults to current: 7885661760)
As a result, I expect both steps to download a different artifact (one from run 7840389011 and one from run 7885661760), but instead both steps seem to resolve the same artifact to download (artifact IDs are the same)
I can also confirm that run-id
seems to be ignored.
surprised that artifact-id
isn't an input parameter. but also can confirm it is broken.
##[debug][Request] ListArtifacts https://results-receiver.actions.githubusercontent.com/twirp/github.actions.results.api.v1.ArtifactService/ListArtifacts
##[debug][Response] - 200
##[debug]Headers: {
##[debug] "content-length": "16",
##[debug] "content-type": "application/json",
##[debug]Body: {
##[debug] "artifacts": []
##[debug]}
Ok i have this bug =/
Same the run-id doesn't work
I am fairly sure the fix is that you have to specify the github-token
option whenever you specify the run-id
of another run
I am fairly sure the fix is that you have to specify the
github-token
option whenever you specify therun-id
of another run
Even so, it should not silently fail