@@ -138,6 +138,7 @@ type releaseNotesOptions struct {
138
138
githubOrg string
139
139
draftRepo string
140
140
mapProviders []string
141
+ includeLabels []string
141
142
}
142
143
143
144
type releaseNotesResult struct {
@@ -241,6 +242,14 @@ func init() {
241
242
"update the cloned repository to fetch any upstream change (default: true)" ,
242
243
)
243
244
245
+ releaseNotesCmd .PersistentFlags ().StringSliceVarP (
246
+ & releaseNotesOpts .includeLabels ,
247
+ "include-labels" ,
248
+ "l" ,
249
+ []string {},
250
+ "only PRs with one of these labels are considered. Set to empty to include all PRs" ,
251
+ )
252
+
244
253
rootCmd .AddCommand (releaseNotesCmd )
245
254
}
246
255
@@ -909,6 +918,7 @@ func releaseNotesJSON(repoPath, tag string) (jsonString string, err error) {
909
918
notesOptions .Debug = logrus .StandardLogger ().Level >= logrus .DebugLevel
910
919
notesOptions .MapProviderStrings = releaseNotesOpts .mapProviders
911
920
notesOptions .AddMarkdownLinks = true
921
+ notesOptions .IncludeLabels = releaseNotesOpts .includeLabels
912
922
913
923
// If the release for the tag we are using has a mapping directory,
914
924
// add it to the mapProviders array to read the edits from the release team:
@@ -964,6 +974,7 @@ func gatherNotesFrom(repoPath, startTag string) (*notes.ReleaseNotes, error) {
964
974
notesOptions .MapProviderStrings = releaseNotesOpts .mapProviders
965
975
notesOptions .ListReleaseNotesV2 = releaseNotesOpts .listReleaseNotesV2
966
976
notesOptions .AddMarkdownLinks = true
977
+ notesOptions .IncludeLabels = releaseNotesOpts .includeLabels
967
978
968
979
if err := notesOptions .ValidateAndFinish (); err != nil {
969
980
return nil , err
0 commit comments