@@ -68,6 +68,12 @@ func isDependabotPR(pr *github.PullRequestPayload) bool {
6868 return login == "dependabot[bot]" || login == "dependabot-preview[bot]" || login == "dependabot"
6969}
7070
71+ func isKonfluxBotPR (pr * github.PullRequestPayload ) bool {
72+ // Check if the PR author is Red Hat Konflux bot
73+ login := pr .PullRequest .User .Login
74+ return login == "red-hat-konflux-kflux-prd-rh02[bot]" || login == "red-hat-konflux-kflux-prd-rh02"
75+ }
76+
7177func openOrSync (gitRepo * git.Git , pr * github.PullRequestPayload , gh ghclient.GH ) error {
7278 prNum := int (pr .Number )
7379
@@ -78,13 +84,13 @@ func openOrSync(gitRepo *git.Git, pr *github.PullRequestPayload, gh ghclient.GH)
7884
7985 readyToReviewMsg := ""
8086 if config != nil && config .LabelApproved != nil {
81- // Add ready-to-test label for Dependabot PRs when opened
82- if pr .Action == "opened" && isDependabotPR (pr ) {
87+ // Add ready-to-test label for Dependabot and Konflux bot PRs when opened
88+ if pr .Action == "opened" && ( isDependabotPR (pr ) || isKonfluxBotPR ( pr ) ) {
8389 label := * config .LabelApproved .Label
84- klog .Infof ("Adding label %s to Dependabot PR #%d" , label , prNum )
90+ klog .Infof ("Adding label %s to PR #%d from %s " , label , prNum , pr . PullRequest . User . Login )
8591 err = gh .AddLabel (prNum , label )
8692 if err != nil {
87- klog .Errorf ("Error while adding label %s to Dependabot PR #%d: %s" , label , prNum , err )
93+ klog .Errorf ("Error while adding label %s to PR #%d from %s : %s" , label , prNum , pr . PullRequest . User . Login , err )
8894 }
8995 } else {
9096 readyToReviewMsg += fmt .Sprintf ("\n 🚀 Full E2E won't run until the %q label is applied. " +
0 commit comments