Skip to content

Commit

Permalink
ignore no release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
menghanl committed Jun 14, 2021
1 parent 06066af commit 6037ca8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions notes/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ func GenerateNotes(org, repo, version string, prs []*github.Issue, filters Filte
if filters.Ignore != nil && filters.Ignore(pr) {
continue
}
if shouldIgnore(pr) {
continue
}

label := pickMostWeightedLabel(pr.Labels)
_, ok := labelToSectionName[label]
Expand Down Expand Up @@ -96,3 +99,15 @@ func getReleaseTitle(pr *github.Issue) (string, bool) {
}
return strings.TrimSpace(strings.TrimPrefix(strings.TrimPrefix(n, "- "), "* ")), true
}

const noReleaseNotesLabel = "no release notes"

// Return true if labels contain "no release notes".
func shouldIgnore(pr *github.Issue) bool {
for _, l := range pr.Labels {
if l.GetName() == noReleaseNotesLabel {
return true
}
}
return false
}

0 comments on commit 6037ca8

Please sign in to comment.