File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,17 @@ func (m *MetricsCollectorGithubWorkflows) Collect(callback chan<- func()) {
253253}
254254
255255for _ , repo := range repositories {
256+ // skip archived or disabled repos
257+ if repo .GetArchived () || repo .GetDisabled () {
258+ continue
259+ }
260+
261+ // skip repos without default branch (not setup yet?)
262+ if repo .GetDefaultBranch () == "" {
263+ // repo doesn't have default branch
264+ continue
265+ }
266+
256267// build custom properties
257268propLabels := prometheus.Labels {}
258269if len (Opts .GitHub .Repositories .CustomProperties ) >= 1 {
@@ -277,11 +288,7 @@ func (m *MetricsCollectorGithubWorkflows) Collect(callback chan<- func()) {
277288}
278289repositoryMetric .AddInfo (labels )
279290
280- if repo .GetDefaultBranch () == "" {
281- // repo doesn't have default branch
282- continue
283- }
284-
291+ // get workflows
285292workflows , err := m .getRepoWorkflows (org , repo .GetName ())
286293if err != nil {
287294panic (err )
You can’t perform that action at this time.
0 commit comments