Skip to content

Commit

Permalink
Merge pull request #26 from Adirio/wip-support
Browse files Browse the repository at this point in the history
✨ Support adding a WIP prefix to the title as understood by prow
  • Loading branch information
k8s-ci-robot committed Dec 2, 2020
2 parents 97c62fb + 4aa0c6a commit 09382ff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions notes/verify/title.go
Expand Up @@ -18,10 +18,14 @@ package verify

import (
"fmt"
"regexp"

"sigs.k8s.io/kubebuilder-release-tools/notes/common"
)

// Extracted from kubernetes/test-infra/prow/plugins/wip/wip-label.go
var wipRegex = regexp.MustCompile(`(?i)^\W?WIP\W`)

type prTitleError struct {
title string
}
Expand All @@ -47,6 +51,9 @@ More details can be found at [sigs.k8s.io/controller-runtime/VERSIONING.md](http
// returning a message describing what was found on success, and a special
// error (with more detailed help via .Help) on failure.
func VerifyPRTitle(title string) (string, error) {
// Remove the WIP prefix if found
title = wipRegex.ReplaceAllString(title, "")

prType, finalTitle := common.PRTypeFromTitle(title)
if prType == common.UncategorizedPR {
return "", &prTitleError{title: title}
Expand Down

0 comments on commit 09382ff

Please sign in to comment.