Skip to content

Commit 860c1bc

Browse files
authored
update comment when draft pr is ignored (#2289)
1 parent 6c26b53 commit 860c1bc

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

backend/controllers/github_comment.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func handleIssueCommentEvent(gh utils.GithubClientProvider, payload *github.Issu
4040
repoFullName := *payload.Repo.FullName
4141
cloneURL := *payload.Repo.CloneURL
4242
issueNumber := *payload.Issue.Number
43-
43+
4444
if payload.Installation == nil {
4545
slog.Error("Installation is nil in payload", "issueNumber", issueNumber)
4646
return fmt.Errorf("installation is missing from payload")
@@ -198,6 +198,10 @@ func handleIssueCommentEvent(gh utils.GithubClientProvider, payload *github.Issu
198198
"issueNumber", issueNumber,
199199
"isDraft", isDraft,
200200
)
201+
if os.Getenv("DIGGER_REPORT_BEFORE_LOADING_CONFIG") == "1" {
202+
// This one is for aggregate reporting
203+
commentReporterManager.UpdateComment(":construction_worker: Ignoring event as it is a draft and draft PRs are configured to be ignored")
204+
}
201205
return nil
202206
}
203207

backend/controllers/github_pull_request.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,10 @@ func handlePullRequestEvent(gh utils.GithubClientProvider, payload *github.PullR
320320
"prNumber", prNumber,
321321
"isDraft", isDraft,
322322
)
323+
if os.Getenv("DIGGER_REPORT_BEFORE_LOADING_CONFIG") == "1" {
324+
// This one is for aggregate reporting
325+
commentReporterManager.UpdateComment(":construction_worker: Ignoring event as it is a draft and draft PRs are configured to be ignored")
326+
}
323327
return nil
324328
}
325329

0 commit comments

Comments
 (0)