File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -200,11 +200,31 @@ func (g prEntriesProcessor) generateNoteEntry(p *pr) *notesEntry {
200200 }
201201
202202 entry .prNumber = fmt .Sprintf ("%d" , p .number )
203+ entry .title = updateTitle (entry .title )
203204 entry .title = formatPREntry (entry .title , entry .prNumber )
204205
205206 return entry
206207}
207208
209+ // UpdateTitle updates a title by removing the "MULTIPLE_AREAS[]" substrings and multiple colons(:).
210+ func updateTitle (input string ) string {
211+ // Remove "MULTIPLE_AREAS[" from the input
212+ input = strings .Replace (input , "MULTIPLE_AREAS[" , "" , 1 )
213+ input = strings .Replace (input , "]" , "" , 1 )
214+
215+ // Remove the extra colons from the title
216+ colonCount := strings .Count (input , ":" )
217+ if colonCount == 2 {
218+ // Find the position of the first colon
219+ firstColonIndex := strings .Index (input , ":" )
220+ // Extract the part after the first colon and remove any leading spaces
221+ partAfterColon := strings .TrimSpace (input [firstColonIndex + 1 :])
222+ // Replace the first colon with "/"
223+ input = input [:firstColonIndex ] + "/" + partAfterColon
224+ }
225+ return input
226+ }
227+
208228// extractArea processes the PR labels to extract the area.
209229func (g prEntriesProcessor ) extractArea (pr * pr ) string {
210230 var areaLabels []string
You can’t perform that action at this time.
0 commit comments