Extend regexp to match orgs and projects include - and _ chars #19

Merged
adamm merged 1 commits from adrianSuSE/autogits:main into main 2025-04-01 09:56:13 +02:00

View File

@@ -368,7 +368,7 @@ func processPullNotification(gitea common.Gitea, thread *models.NotificationThre
log.Panicln(err)
}
rx := regexp.MustCompile(`^https://src\.(?:open)?suse\.(?:org|de)/api/v\d+/repos/(?<org>[a-zA-Z0-9]+)/(?<project>[_a-zA-Z0-9]+)/issues/(?<num>[0-9]+)$`)
rx := regexp.MustCompile(`^https://src\.(?:open)?suse\.(?:org|de)/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 {