Skip to content

Commit a72d7f8

Browse files
fix: silently skip repos without digger config for org-wide installations (#2488)
1 parent 806fec2 commit a72d7f8

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

backend/controllers/github_pull_request.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"runtime/debug"
1010
"slices"
1111
"strconv"
12+
"strings"
1213

1314
"github.com/diggerhq/digger/backend/ci_backends"
1415
config2 "github.com/diggerhq/digger/backend/config"
@@ -136,7 +137,17 @@ func handlePullRequestEvent(gh utils.GithubClientProvider, payload *github.PullR
136137
)
137138
return nil
138139
}
139-
140+
141+
// Silently skip repos without digger.yml - this is expected for org-wide installations
142+
if strings.Contains(err.Error(), "could not find digger.yml") ||
143+
strings.Contains(err.Error(), "could not find digger.yaml") {
144+
slog.Info("No Digger config found, skipping repo",
145+
"prNumber", prNumber,
146+
"repoFullName", repoFullName,
147+
)
148+
return nil
149+
}
150+
140151
slog.Error("Error getting Digger config for PR",
141152
"prNumber", prNumber,
142153
"repoFullName", repoFullName,
@@ -504,7 +515,7 @@ func handlePullRequestEvent(gh utils.GithubClientProvider, payload *github.PullR
504515
commentReporterManager.UpdateComment(fmt.Sprintf(":x: Could not retrieve created batch: %v", err))
505516
return fmt.Errorf("error getting digger batch")
506517
}
507-
518+
508519
if config.CommentRenderMode == digger_config.CommentRenderModeGroupByModule {
509520
slog.Info("Using GroupByModule render mode for comments", "prNumber", prNumber)
510521

0 commit comments

Comments
 (0)