Labbs / github-actions-exporter

github-actions-exporter for prometheus
MIT License
224 stars 83 forks source link

skip “runners” if no perms #57

Open srl295 opened 1 year ago

srl295 commented 1 year ago

i don't have any hosted runners, but wanted to keep an eye on the workflow status.

Using this patch locally. Allows use with a find grained token.

diff --git a/pkg/metrics/metrics.go b/pkg/metrics/metrics.go
index c9206d8..e375193 100644
--- a/pkg/metrics/metrics.go
+++ b/pkg/metrics/metrics.go
@@ -59,10 +59,10 @@ func InitMetrics() {
        }

        go getBillableFromGithub()
-       go getRunnersFromGithub()
-       go getRunnersOrganizationFromGithub()
+       //go getRunnersFromGithub()
+       //go getRunnersOrganizationFromGithub()
        go getWorkflowRunsFromGithub()
-       go getRunnersEnterpriseFromGithub()
+       //go getRunnersEnterpriseFromGithub()
 }

 // NewClient creates a Github Client