Skip to content

Commit

Permalink
Merge pull request #1847 from intuit/slack-validation-bug
Browse files Browse the repository at this point in the history
groups authors
  • Loading branch information
hipstersmoothie committed Mar 3, 2021
2 parents 4216e64 + ebeb6de commit 23b8a56
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion plugins/slack/__tests__/__snapshots__/slack.test.ts.snap
Expand Up @@ -170,7 +170,8 @@ Array [
Object {
"elements": Array [
Object {
"text": "• Andrew Lisowski (<https://github.com/hipstersmoothie|@hipstersmoothie>)",
"text": "• Andrew Lisowski (<https://github.com/hipstersmoothie|@hipstersmoothie>)
Other",
"type": "mrkdwn",
},
],
Expand Down
1 change: 1 addition & 0 deletions plugins/slack/__tests__/slack.test.ts
Expand Up @@ -503,6 +503,7 @@ describe("convertToBlocks", () => {
#### Authors: 1
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
- Other
`)
)
).toMatchSnapshot();
Expand Down
5 changes: 4 additions & 1 deletion plugins/slack/src/index.ts
Expand Up @@ -126,12 +126,15 @@ export function convertToBlocks(
} else if (line.startsWith("*Authors:")) {
currentMessage.push(createDividerBlock());
currentMessage.push(createContextBlock(line));
const authorLines: string[] = [];

for (const authorLine of lineIterator) {
if (authorLine) {
currentMessage.push(createContextBlock(authorLine));
authorLines.push(authorLine);
}
}

currentMessage.push(createContextBlock(authorLines.join("\n")));
} else if (line.match(CHANGELOG_LINE)) {
const lines: string[] = [line];

Expand Down

0 comments on commit 23b8a56

Please sign in to comment.