Skip to content

Commit 75cd82a

Browse files
authored
fix: maybe remove the preceeding newline if it exists (#127)
* fix: maybe remove the preceeding newline if it exists * chore: add OWNERS_ALIASES
1 parent 793a580 commit 75cd82a

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

OWNERS_ALIASES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
foreignAliases:
2+
- name: mqube-community
3+
org: spring-financial-group

pkg/releasenotes/usecase/releasenotesuc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (uc *UseCase) GetReleaseNotesFromMDAndTeams(markdown string, teamsInFeather
7777
var (
7878
// This regex is used to find all the bot generated text in the markdown
7979
// Bot generated text is of the form `[//]: # (some-bot-tag)`
80-
botGeneratedTextRegex = regexp.MustCompile(`\n\[//\]: # \((.*)\)`)
80+
botGeneratedTextRegex = regexp.MustCompile(`\n?\[//\]: # \((.*)\)`)
8181
)
8282

8383
func (uc *UseCase) removeBotGeneratedText(text string) string {

pkg/releasenotes/usecase/releasenotesuc_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ func TestParse(t *testing.T) {
227227
},
228228
{
229229
name: "RemoveBotGeneratedText",
230-
inputMarkdown: "### Notify infrastructure\nTest Content\n\n[//]: # (some-bot-content)\nAnother bit of content\n### Notify devs\nMore Test Content",
230+
inputMarkdown: "### Notify infrastructure\n[//]: # (beaver-start)\nTest Content\n\n[//]: # (some-bot-content)\nAnother bit of content\n### Notify devs\nMore Test Content",
231231
expectedNotes: []models.ReleaseNote{
232232
{
233233
Teams: models.Teams{infraTeam},

0 commit comments

Comments
 (0)