# Dynamic Github repo branches as filter

**URL:** <https://community.grafana.com/t/dynamic-github-repo-branches-as-filter/156869>\
**Category:** Grafana\
**Tags:** github, dashboard, plugins\
**Created:** [August 28, 2025, 8:15pm UTC](https://community.grafana.com/t/dynamic-github-repo-branches-as-filter/156869 "2025-08-28T20:15:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![devonsullera](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/devonsullera/32/56286_2.png) [@devonsullera](https://community.grafana.com/u/devonsullera)\
**Post date:** [August 28, 2025, 8:15pm UTC](https://community.grafana.com/t/dynamic-github-repo-branches-as-filter/156869/1 "2025-08-28T20:15:52Z")

</div>

I’m using the Github default template. Anyone knows how to dynamically pull all branches per repository? I tried different variable types, queries, regex, etc. but no clue how to pull all branches. Only have static branch as values which can be defined in the variable.

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/c/d/cde5e9df52f3e2bb3a179320a87478a456ab8afd.png)

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [August 28, 2025, 11:21pm UTC](https://community.grafana.com/t/dynamic-github-repo-branches-as-filter/156869/2 "2025-08-28T23:21:50Z")

</div>

I would use GitHub API with infinity

`repos/{owner}/{repo}/branches`

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/4/b/4bb3630e517553ac4dc789d5040a2f9dd24b6518.png)

---

<div class="post-metadata">

**Author:** ![davidharris](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/davidharris/32/34182_2.png) [@davidharris](https://community.grafana.com/u/davidharris)\
**Post date:** [August 29, 2025, 8:49am UTC](https://community.grafana.com/t/dynamic-github-repo-branches-as-filter/156869/4 "2025-08-29T08:49:11Z")

</div>

If you wanted to still use the github data source for most of the work (and the dashboard) you could update the branch variable to be the `Query` type rather than a hardcoded list - then use the same approach as @yosiasz mentioned to populate this list.

---

<div class="post-metadata">

**Author:** ![devonsullera](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/devonsullera/32/56286_2.png) [@devonsullera](https://community.grafana.com/u/devonsullera)\
**Post date:** [September 10, 2025, 6:10pm UTC](https://community.grafana.com/t/dynamic-github-repo-branches-as-filter/156869/5 "2025-09-10T18:10:39Z")

</div>

Thank you guys for the response, but in my case, I used I just used a query variable with the JSON api. Thanks.
