Skip to content

Commit 9ee788f

Browse files
committed
ensure we skip fork runs
Signed-off-by: Markus Blaschke <[email protected]>
1 parent 215fda1 commit 9ee788f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

metrics_github_workflows.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,14 @@ func (m *MetricsCollectorGithubWorkflows) collectLatestRun(org string, repo *git
478478
workflowRun := row
479479
workflowId := workflowRun.GetWorkflowID()
480480

481+
// skip forks
482+
if workflowRun.GetRepository().Fork != nil && *workflowRun.GetRepository().Fork {
483+
continue
484+
}
485+
if workflowRun.GetHeadRepository().Fork != nil && *workflowRun.GetHeadRepository().Fork {
486+
continue
487+
}
488+
481489
// ignore running/not finished workflow runs
482490
if slices.Contains(githubWorkflowRunningStatus, workflowRun.GetStatus()) {
483491
continue

0 commit comments

Comments
 (0)