Skip to content

Commit 3bc3415

Browse files
committed
Include PRs that use tide squashing
1 parent e4d85c9 commit 3bc3415

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

hack/tools/go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ require (
3535
cloud.google.com/go/compute v1.23.3 // indirect
3636
cloud.google.com/go/compute/metadata v0.2.3 // indirect
3737
cloud.google.com/go/iam v1.1.5 // indirect
38-
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
3938
github.com/MakeNowJust/heredoc v1.0.0 // indirect
4039
github.com/Masterminds/goutils v1.1.1 // indirect
4140
github.com/Masterminds/semver/v3 v3.2.0 // indirect

hack/tools/release/notes/list.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,24 @@ func (l *githubFromToPRLister) listPRs() ([]pr, error) {
119119
return prs, nil
120120
}
121121

122-
var mergeCommitMessage = regexp.MustCompile(`(?m)^Merge pull request #(\d+) .*$`)
122+
var (
123+
mergeCommitMessage = regexp.MustCompile(`(?m)^Merge pull request #(\d+) .*$`)
124+
tideSquashedCommitMessage = regexp.MustCompile(`(?m)^.+\(#(?P<number>\d+)\)$`)
125+
)
123126

124127
func buildSetOfPRNumbers(commits []githubCommitNode) map[string]struct{} {
125128
prNumbers := make(map[string]struct{})
126129
for _, commit := range commits {
127130
match := mergeCommitMessage.FindStringSubmatch(commit.Commit.Message)
128-
if len(match) != 2 {
131+
if len(match) == 2 {
132+
prNumbers[match[1]] = struct{}{}
129133
continue
130134
}
131-
prNumbers[match[1]] = struct{}{}
135+
136+
match = tideSquashedCommitMessage.FindStringSubmatch(commit.Commit.Message)
137+
if len(match) == 2 {
138+
prNumbers[match[1]] = struct{}{}
139+
}
132140
}
133141

134142
return prNumbers

0 commit comments

Comments
 (0)