staging: Filter out notifications which are pure issues (no PRs)
gofmt / Format checking (pull_request) Successful in 5s
go-generate-check / go-generate-check (pull_request) Successful in 14s
gofmt / Linter and static analysis (pull_request) Failing after 1m12s
go-test-unit / go-test-unit (pull_request) Successful in 1m16s
Integration (Selective) / check (pull_request) Successful in 1s
Integration (Selective) / integration (pull_request) Failing after 14m3s

This commit is contained in:
2026-07-16 16:24:40 +02:00
parent 67071219e1
commit be5b873fe4
+5 -2
View File
@@ -663,7 +663,7 @@ func FetchOurLatestActionableReview(gitea common.Gitea, org, repo string, id int
}
func ParseNotificationToPR(thread *models.NotificationThread) (org string, repo string, num int64, err error) {
rx := regexp.MustCompile(`^.*/api/v\d+/repos/(?<org>[-_a-zA-Z0-9]+)/(?<project>[-_a-zA-Z0-9]+)/issues/(?<num>[0-9]+)$`)
rx := regexp.MustCompile(`^.*/api/v\d+/repos/(?<org>[-_a-zA-Z0-9.]+)/(?<project>[-_a-zA-Z0-9.]+)/issues/(?<num>[0-9]+)$`)
notification := thread.Subject
match := rx.FindStringSubmatch(notification.URL)
if match == nil {
@@ -688,7 +688,10 @@ func ProcessPullNotification(obs common.ObsClientInterface, gitea common.Gitea,
org, repo, num, err := ParseNotificationToPR(thread)
if err != nil {
common.LogError(err.Error())
common.LogDebug("Skipping non-PR notification:", err.Error())
if !IsDryRun {
gitea.SetNotificationRead(thread.ID)
}
return
}