You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dawidd6/action-download-artifact@v17 - Download older version sometimes, though most recent version exists #428
Unfortunately mine are private firm repo, let me try to reproduce it when I have spare time.
I noticed this error started earlier this week. I've tried to debug it but it's harder when the results are inconsistent. Any test you want me to run first?
I dug into this. Short version: I can't find a code regression that explains it on v2/v17/v24, but I did find places where the action makes itself fragile to a bad API response, and I've changed those.
This is not the #424 bug. That one was the status= query param added in #417, which makes GitHub return runs in a non-newest-first order; #425 fixed it by filtering the conclusion locally again. Only v23 ever shipped it — v24 is the fix, and v17 and v2 never had it (both already filter workflow_conclusion client-side).
What @Panzerschrek's log shows. Checking against the public repo:
main.yml + branch=master → 123 runs, ordering is exactly created_at descending, stable across repeated calls and on every page. First item is run #5170 (2026-09-13), whose artifact exists and is not expired.
The run the action picked, 20638977995, is position 45 in that list: 2026-01-01, run_attempt: 1, master, success, not a fork.
With check_artifacts: false and search_artifacts: false there is no code path that can skip 44 valid runs — the action takes the first run that matches. So the response at that moment was not newest-first. Same class of problem as #95 back in 2021.
Changes, in the next release:
Candidate runs are now sorted newest-first by the action instead of trusting the response order, and fetched with per_page=100. In the case above the stale run then lands on page 1, so a shuffled page gets corrected. It does not help if whole pages come back out of order — that would mean draining every page, which I don't want to pay for on repos with thousands of runs.
Expired artifacts no longer satisfy check_artifacts / search_artifacts. At the time of that log the stale run did still list its artifact with expired: true (GitHub has purged the record since), so check_artifacts: true would not have skipped it. Now it will, which also makes it a usable workaround.
Unrelated, spotted while reading: dry_run: false was truthy and silently enabled dry run mode. Fixed.
@ctsmohanreddy072 yours may be a different thing. name: ExportedARM with name_is_regexp: true matches everyExportedARM-<n> in the selected run, and re-run runs keep the artifacts from all attempts (#384) — so you can end up with ExportedARM-100/ and ExportedARM-101/ both downloaded, and a later step reading the older one. Could you post the full log, including the ==> (found) Run ID and ==> Artifact: lines? Also, workflow: build yml in your snippet has to be the workflow filename (build.yml) or the numeric id, not the display name.
@ColludingPudding were you on v23 before moving to v24? And do the failing runs line up with anything on githubstatus.com? Both symptoms you describe (an older run, and "no artifact found") fall out of one truncated or misordered response, so I'd expect a single cause rather than two bugs.
The action intermittently selected an older successful artifact even though a newer successful run containing the same artifact existed before the consuming workflow started. The selected artifact was still valid and had a future expiration date, so this does not appear to be the expired-artifact case addressed by PR #429.
Sanitized example:
==> (found) Run ID: ######
==> (found) Run date: 2026-02-18T13:23:44Z
==> Artifact: ######
I also have a diagnostic branch that prints the candidate ordering. I ran it nine times, but it did not reproduce the stale selection. That branch consistently showed the expected ordering during those runs. The failure is intermittent, so I do not know whether the diagnostic workflow changes the timing or whether the bad API response is rare.
Since PR #429 sorts runs within the returned page but does not drain and globally sort all pages, could this still occur if GitHub returns an incomplete or misordered paginated response? Is there a recommended way to capture the raw workflow-runs API response from the failing invocation, or any other information that would help distinguish an API response issue from an action-selection issue?
Thanks for the detailed report. You're right that #429 only sorts within a page, but with check_artifacts + search_artifacts there are two other ways a newer run can be dropped silently, and your diagnostic branch wouldn't catch either because it only printed the ordering:
The run list lags behind. The newer run can still show up without a success conclusion for a short while after it finishes, so the conclusion filter skips it.
The artifact list lags or comes back empty. For every candidate, search_artifacts calls the list-artifacts endpoint for that run. If that call returns an empty or incomplete list, the run is skipped and the action falls back to an older one.
The 2026-02-18 date is also telling. If more than ~100 runs of that workflow landed on main since then, the Feb run couldn't have been on page 1, which means every run on page 1 was filtered out. That fits (2) better than a shuffled page.
The next release logs every page it fetches (raw order) and every skipped run with the reason (status/conclusion, or the artifact names it saw). To capture the failing invocation, set a repository variableACTIONS_STEP_DEBUG to true and leave it on until it happens again, then post the ==> Fetched page / ==> Skipping run lines.
Meanwhile, it would help to know:
roughly how many main runs of that workflow happened between 2026-02-18 and the bad pick
how the consuming workflow is triggered (e.g. workflow_run: completed) and how soon after the producer finished
whether it still happens with search_artifacts: false (keep check_artifacts: true; with an exact name a missing artifact still fails the step)
I think there have been hundreds of runs between that workflow and the bad pick. The consumer is triggered by a push to a branch within it and does not depend on the producer except for requiring a valid artifact (the requirements for validity don't change often but have changed recently with an addition of a required file). I will try setting ACTIONS_STEP_DEBUG to true next.
@dawidd6 - Mine is private repository, so I'have masked the sensitive ones with the full log details. Please find the below which I'm using currently.
The build.yml will always upload the artifact with format as ExportedARM-
Let's say if the builld.yml is triggered and build number as 112, then artifact will be ExportedARM-112
The qa.yml is the workflow that downloads the lastest successful artifact from build.yml
The qa.yml has below to achieve that
Logs:
Repository:
Artifact name: ExportedARM
Local path ./
Workflow name: build.yml
Workflow conclusion: success
Branch: development
Allow forks: false
(Found) Run ID: *******
(Found) Run date: *******
Artifact: *****
Downloading: ExportedARM-92.zip (213.51 kb)
Extracting: ExportedARM-92.zip
Issue: Some times it downloads the older artifact like Exported-92.zip, though latest successful artifact is 112 exists. Up on rerun the issue gets fixed. But I did not understand why is it picking the older artifact though the newer one exists
The next release logs every page it fetches (raw order) and every skipped run with the reason (status/conclusion, or the artifact names it saw). To capture the failing invocation, set a repository variableACTIONS_STEP_DEBUG to true and leave it on until it happens again, then post the ==> Fetched page / ==> Skipping run lines.
There were no ==> Skipping run lines, but this is what showed up (with number sanitized):
@ereizas247 thanks, that debug line settled it: Fetched page of 1 runs out of hundreds means GitHub returned a truncated list, not that the action filtered runs out.
I reproduced it on a public repo (Panzerschrek/U-00DC-Sprache, main.yml, branch=master). When the runs API is queried with branch, event, head_sha or status, it goes through GitHub's search index, and that index intermittently returns a random subset of the matching runs:
Query
Calls
Newest run missing
branch=master
98
6
status=success
20
3
no filter
56
0
A bad response looked like 18 of 114 runs, scattered across the whole history (#5169, 5118, 5108, 5018 … 4950), still sorted newest-first, with total_count: 18 and no next page. Nothing in the response shows anything is missing, so the action picks the newest run it was given, which can be months old. The failures come in bursts, which is why a re-run fixes it and why diagnostic runs rarely catch it. It also explains the reports on v2, v6, v17 and v25 alike.
#432 works around it: when branch, event or commit/pr is set, the action also fetches the workflow's latest 100 runs without filters, matches them locally and merges in anything the filtered response left out. It won't help if a branch's newest run isn't among the workflow's latest 100 runs. That's rare for main/development, where this was reported.
It's released in v27. If you still see a stale pick on @v27, please post the ==> Fetched page and ==> Merging runs debug lines.
@ctsmohanreddy072 yours looks like the same bug. Please upgrade from v17 to @v27, and double-check the input is spelled name_is_regexp (your snippet has name_is_regex).
Another data point, on v21: branch=main for one workflow returned 15 runs going back to March and left out every main run from the last month (about 10), so we deployed a month-old build to production :(
The same query without branch was correct. v27's merge of the latest 100 unfiltered runs would have caught our case, but it won't help once the newest match falls outside those 100, e.g. a workflow that runs on every branch where the target branch builds rarely. We dropped branch and match by artifact name (search_artifacts: true) instead, since our artifact names already include the branch.
Activity
dawidd6 commentedon Sep 24, 2026
Try v24
ColludingPudding commentedon Sep 25, 2026
I have been able to replicate this issue on v24. After multiple runs, it eithers
I'm only specifying workflow, branch and name.
dawidd6 commentedon Sep 25, 2026
Do you have some repos to show me?
ColludingPudding commentedon Sep 25, 2026
Unfortunately mine are private firm repo, let me try to reproduce it when I have spare time.
I noticed this error started earlier this week. I've tried to debug it but it's harder when the results are inconsistent. Any test you want me to run first?
Panzerschrek commentedon Sep 25, 2026
Same problem for me:
A build from 1st January is selected for some reason, but there are a lot of newer builds, the newest one is only a couple of weeks old.
dawidd6 commentedon Sep 25, 2026
Do you have the public repo where this workflow runs?
dawidd6 commentedon Sep 25, 2026
I dug into this. Short version: I can't find a code regression that explains it on v2/v17/v24, but I did find places where the action makes itself fragile to a bad API response, and I've changed those.
This is not the #424 bug. That one was the
status=query param added in #417, which makes GitHub return runs in a non-newest-first order; #425 fixed it by filtering the conclusion locally again. Only v23 ever shipped it — v24 is the fix, and v17 and v2 never had it (both already filterworkflow_conclusionclient-side).What @Panzerschrek's log shows. Checking against the public repo:
main.yml+branch=master→ 123 runs, ordering is exactlycreated_atdescending, stable across repeated calls and on every page. First item is run #5170 (2026-09-13), whose artifact exists and is not expired.20638977995, is position 45 in that list: 2026-01-01,run_attempt: 1, master, success, not a fork.With
check_artifacts: falseandsearch_artifacts: falsethere is no code path that can skip 44 valid runs — the action takes the first run that matches. So the response at that moment was not newest-first. Same class of problem as #95 back in 2021.Changes, in the next release:
per_page=100. In the case above the stale run then lands on page 1, so a shuffled page gets corrected. It does not help if whole pages come back out of order — that would mean draining every page, which I don't want to pay for on repos with thousands of runs.check_artifacts/search_artifacts. At the time of that log the stale run did still list its artifact withexpired: true(GitHub has purged the record since), socheck_artifacts: truewould not have skipped it. Now it will, which also makes it a usable workaround.dry_run: falsewas truthy and silently enabled dry run mode. Fixed.@ctsmohanreddy072 yours may be a different thing.
name: ExportedARMwithname_is_regexp: truematches everyExportedARM-<n>in the selected run, and re-run runs keep the artifacts from all attempts (#384) — so you can end up withExportedARM-100/andExportedARM-101/both downloaded, and a later step reading the older one. Could you post the full log, including the==> (found) Run IDand==> Artifact:lines? Also,workflow: build ymlin your snippet has to be the workflow filename (build.yml) or the numeric id, not the display name.@ColludingPudding were you on v23 before moving to v24? And do the failing runs line up with anything on githubstatus.com? Both symptoms you describe (an older run, and "no artifact found") fall out of one truncated or misordered response, so I'd expect a single cause rather than two bugs.
fix: do not rely on API workflow run ordering (#429)
ColludingPudding commentedon Sep 25, 2026
I was on v6. Just ran some test on v25 and looks like its working now. Thanks for the quick response!
ereizas247 commentedon Sep 28, 2026
I am still seeing this behavior after upgrading to the release containing PR #429.
This is a private repository, so I cannot provide a public reproduction or full logs, but the workflow uses the direct action:
The relevant inputs are:
name_is_regexpis not enabled.The action intermittently selected an older successful artifact even though a newer successful run containing the same artifact existed before the consuming workflow started. The selected artifact was still valid and had a future expiration date, so this does not appear to be the expired-artifact case addressed by PR #429.
Sanitized example:
I also have a diagnostic branch that prints the candidate ordering. I ran it nine times, but it did not reproduce the stale selection. That branch consistently showed the expected ordering during those runs. The failure is intermittent, so I do not know whether the diagnostic workflow changes the timing or whether the bad API response is rare.
Since PR #429 sorts runs within the returned page but does not drain and globally sort all pages, could this still occur if GitHub returns an incomplete or misordered paginated response? Is there a recommended way to capture the raw workflow-runs API response from the failing invocation, or any other information that would help distinguish an API response issue from an action-selection issue?
dawidd6 commentedon Sep 28, 2026
Thanks for the detailed report. You're right that #429 only sorts within a page, but with
check_artifacts+search_artifactsthere are two other ways a newer run can be dropped silently, and your diagnostic branch wouldn't catch either because it only printed the ordering:successconclusion for a short while after it finishes, so the conclusion filter skips it.search_artifactscalls the list-artifacts endpoint for that run. If that call returns an empty or incomplete list, the run is skipped and the action falls back to an older one.The
2026-02-18date is also telling. If more than ~100 runs of that workflow landed onmainsince then, the Feb run couldn't have been on page 1, which means every run on page 1 was filtered out. That fits (2) better than a shuffled page.The next release logs every page it fetches (raw order) and every skipped run with the reason (status/conclusion, or the artifact names it saw). To capture the failing invocation, set a repository variable
ACTIONS_STEP_DEBUGtotrueand leave it on until it happens again, then post the==> Fetched page/==> Skipping runlines.Meanwhile, it would help to know:
mainruns of that workflow happened between 2026-02-18 and the bad pickworkflow_run: completed) and how soon after the producer finishedsearch_artifacts: false(keepcheck_artifacts: true; with an exactnamea missing artifact still fails the step)feat: log skipped workflow runs in debug mode
ereizas247 commentedon Sep 28, 2026
I think there have been hundreds of runs between that workflow and the bad pick. The consumer is triggered by a push to a branch within it and does not depend on the producer except for requiring a valid artifact (the requirements for validity don't change often but have changed recently with an addition of a required file). I will try setting
ACTIONS_STEP_DEBUGto true next.ctsmohanreddy072 commentedon Sep 29, 2026
@dawidd6 - Mine is private repository, so I'have masked the sensitive ones with the full log details. Please find the below which I'm using currently.
The build.yml will always upload the artifact with format as ExportedARM-
Let's say if the builld.yml is triggered and build number as 112, then artifact will be ExportedARM-112
The qa.yml is the workflow that downloads the lastest successful artifact from build.yml
The qa.yml has below to achieve that
uses: dawidd6/action-download-artifact@v17
github_token: ...
workflow: build.yml
branch: development
name: ExportedARM
name_is_regex: true
Logs:
Repository:
Artifact name: ExportedARM
Local path ./
Workflow name: build.yml
Workflow conclusion: success
Branch: development
Allow forks: false
(Found) Run ID: *******
(Found) Run date: *******
Artifact: *****
Downloading: ExportedARM-92.zip (213.51 kb)
Extracting: ExportedARM-92.zip
Issue: Some times it downloads the older artifact like Exported-92.zip, though latest successful artifact is 112 exists. Up on rerun the issue gets fixed. But I did not understand why is it picking the older artifact though the newer one exists
ereizas247 commentedon Sep 29, 2026
There were no
==> Skipping runlines, but this is what showed up (with number sanitized):##[debug]==> Fetched page of 1 runs: ########And that was the run that was selected.
fix: merge unfiltered runs into filtered run search (#432)
dawidd6 commentedon Sep 29, 2026
@ereizas247 thanks, that debug line settled it:
Fetched page of 1 runsout of hundreds means GitHub returned a truncated list, not that the action filtered runs out.I reproduced it on a public repo (
Panzerschrek/U-00DC-Sprache,main.yml,branch=master). When the runs API is queried withbranch,event,head_shaorstatus, it goes through GitHub's search index, and that index intermittently returns a random subset of the matching runs:branch=masterstatus=successA bad response looked like 18 of 114 runs, scattered across the whole history (
#5169, 5118, 5108, 5018 … 4950), still sorted newest-first, withtotal_count: 18and no next page. Nothing in the response shows anything is missing, so the action picks the newest run it was given, which can be months old. The failures come in bursts, which is why a re-run fixes it and why diagnostic runs rarely catch it. It also explains the reports on v2, v6, v17 and v25 alike.#432 works around it: when
branch,eventorcommit/pris set, the action also fetches the workflow's latest 100 runs without filters, matches them locally and merges in anything the filtered response left out. It won't help if a branch's newest run isn't among the workflow's latest 100 runs. That's rare formain/development, where this was reported.It's released in v27. If you still see a stale pick on
@v27, please post the==> Fetched pageand==> Merging runsdebug lines.@ctsmohanreddy072 yours looks like the same bug. Please upgrade from v17 to
@v27, and double-check the input is spelledname_is_regexp(your snippet hasname_is_regex).cahva commentedon Oct 5, 2026
Another data point, on v21: branch=main for one workflow returned 15 runs going back to March and left out every main run from the last month (about 10), so we deployed a month-old build to production :(
The same query without branch was correct. v27's merge of the latest 100 unfiltered runs would have caught our case, but it won't help once the newest match falls outside those 100, e.g. a workflow that runs on every branch where the target branch builds rarely. We dropped branch and match by artifact name (search_artifacts: true) instead, since our artifact names already include the branch.