# How to get a run id by its index?

**URL:** <https://forum.gitea.com/t/how-to-get-a-run-id-by-its-index/11422>\
**Category:** Actions\
**Created:** [June 20, 2025, 6:16am UTC](https://forum.gitea.com/t/how-to-get-a-run-id-by-its-index/11422 "2025-06-20T06:16:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NameHasBeenTaken](https://avatars.discourse-cdn.com/v4/letter/n/aca169/32.png) [@NameHasBeenTaken](https://forum.gitea.com/u/NameHasBeenTaken)\
**Post date:** [June 20, 2025, 6:16am UTC](https://forum.gitea.com/t/how-to-get-a-run-id-by-its-index/11422/1 "2025-06-20T06:16:40Z")

</div>

Hello! Recent update (1.24.0) has introduced an artifact download API which allows to download artifacts using `christopherhx/gitea-download-artifact@v4` action (see more: [Artifacts download api for artifact actions v4 by ChristopherHX · Pull Request #33510 · go-gitea/gitea · GitHub](https://github.com/go-gitea/gitea/pull/33510)).  
However it requires a run id to be passed to the action. Can somebody please tell me how to get the run id knowing run index?

---

<div class="post-metadata">

**Author:** ![hwaastad](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/hwaastad/32/938_2.png) [@hwaastad](https://forum.gitea.com/u/hwaastad)\
**Post date:** [September 14, 2025, 7:48pm UTC](https://forum.gitea.com/t/how-to-get-a-run-id-by-its-index/11422/2 "2025-09-14T19:48:44Z")

</div>

Hi, did you ever figure this one out?  
For my “splitted“ workflows, I have to do like this: (using actions/github-script)

1. artifact name in pull request: name-[pr-number]
2. in main merge:  
2.1 look up pr based on merge-commit\_sha = context.sha  
2.1 lookup artifacts based on artifact-name to get workflow\_run.id
3. download artifact based on name and run-id.

It works, but is somewhat cumbersome.
