@@ -63,12 +63,18 @@ var (
63
63
unknown ,
64
64
}
65
65
66
+ repo = flag .String ("repository" , "kubernetes-sigs/cluster-api" , "The tag or commit to start from." )
67
+
66
68
fromTag = flag .String ("from" , "" , "The tag or commit to start from." )
67
69
68
70
since = flag .String ("since" , "" , "Include commits starting from and including this date. Accepts format: YYYY-MM-DD" )
69
71
until = flag .String ("until" , "" , "Include commits up to and including this date. Accepts format: YYYY-MM-DD" )
70
72
numWorkers = flag .Int ("workers" , 10 , "Number of concurrent routines to process PR entries. If running into GitHub rate limiting, use 1." )
71
73
74
+ prefixAreaLabel = flag .Bool ("prefix-area-label" , true , "If enabled, will prefix the area label." )
75
+
76
+ addKubernetesVersionSupport = flag .Bool ("add-kubernetes-version-support" , true , "If enabled, will add the Kubernetes version support header." )
77
+
72
78
tagRegex = regexp .MustCompile (`^\[release-[\w-\.]*\]` )
73
79
74
80
userFriendlyAreas = map [string ]string {
@@ -154,7 +160,7 @@ func getAreaLabel(merge string) (string, error) {
154
160
// Get pr id from merge commit
155
161
prID := strings .Replace (strings .TrimSpace (strings .Split (merge , " " )[3 ]), "#" , "" , - 1 )
156
162
157
- cmd := exec .Command ("gh" , "api" , "repos/kubernetes-sigs/cluster-api/ pulls/" + prID ) //nolint:gosec
163
+ cmd := exec .Command ("gh" , "api" , fmt . Sprintf ( "repos/%s/ pulls/%s" , * repo , prID ) ) //nolint:gosec
158
164
159
165
out , err := cmd .CombinedOutput ()
160
166
if err != nil {
@@ -301,15 +307,18 @@ func run() int {
301
307
}
302
308
}
303
309
304
- // TODO Turn this into a link (requires knowing the project name + organization)
305
- fmt .Print (`## 👌 Kubernetes version support
310
+ if * addKubernetesVersionSupport {
311
+ // TODO Turn this into a link (requires knowing the project name + organization)
312
+ fmt .Print (`## 👌 Kubernetes version support
306
313
307
314
- Management Cluster: v1.**X**.x -> v1.**X**.x
308
315
- Workload Cluster: v1.**X**.x -> v1.**X**.x
309
316
310
317
[More information about version support can be found here](https://cluster-api.sigs.k8s.io/reference/versions.html)
311
318
312
319
` )
320
+ }
321
+
313
322
fmt .Printf ("## Changes since %v\n ---\n " , commitRange )
314
323
315
324
fmt .Printf ("## :chart_with_upwards_trend: Overview\n " )
@@ -411,9 +420,14 @@ func generateReleaseNoteEntry(c *commit) (*releaseNoteEntry, error) {
411
420
entry := & releaseNoteEntry {}
412
421
entry .title = trimTitle (c .body )
413
422
var fork string
414
- area , err := getAreaLabel (c .merge )
415
- if err != nil {
416
- return nil , err
423
+
424
+ var area string
425
+ if * prefixAreaLabel {
426
+ var err error
427
+ area , err = getAreaLabel (c .merge )
428
+ if err != nil {
429
+ return nil , err
430
+ }
417
431
}
418
432
419
433
switch {
@@ -458,7 +472,13 @@ func generateReleaseNoteEntry(c *commit) (*releaseNoteEntry, error) {
458
472
if entry .title == "" {
459
473
return entry , nil
460
474
}
461
- entry .title = fmt .Sprintf ("- %s: %s" , area , entry .title )
475
+
476
+ if * prefixAreaLabel {
477
+ entry .title = fmt .Sprintf ("- %s: %s" , area , entry .title )
478
+ } else {
479
+ entry .title = fmt .Sprintf ("- %s" , entry .title )
480
+ }
481
+
462
482
_ , _ = fmt .Sscanf (c .merge , "Merge pull request %s from %s" , & entry .prNumber , & fork )
463
483
entry .title = formatMerge (entry .title , entry .prNumber )
464
484
0 commit comments