Skip to content

Commit

Permalink
Update release note format (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore authored Nov 28, 2024
1 parent 7a7c103 commit dde8f33
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/index.mjs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ function createReleaseNotes(newVersion, newIcons, updatedIcons, removedIcons) {

let releaseNotes = '';
if (newIcons.length > 0) {
releaseNotes += '\n# New Icons\n\n';
releaseNotes += `\n## ${newIcons.length} new ${newIcons.length > 1 ? 'icons' : 'icon'}\n\n`;
for (let newIcon of newIcons.sort(sortAlphabetically)) {
const prs = prNumbersToString(newIcon.prNumbers);
const authors = authorsToString(newIcon.authors);
Expand All @@ -506,7 +506,7 @@ function createReleaseNotes(newVersion, newIcons, updatedIcons, removedIcons) {
}

if (updatedIcons.length > 0) {
releaseNotes += '\n# Updated Icons\n\n';
releaseNotes += `\n## ${updatedIcons.length} updated ${updatedIcons.length > 1 ? 'icons' : 'icon'}\n\n`;
for (let updatedIcon of updatedIcons.sort(sortAlphabetically)) {
const prs = prNumbersToString(updatedIcon.prNumbers);
const authors = authorsToString(updatedIcon.authors);
Expand All @@ -515,7 +515,7 @@ function createReleaseNotes(newVersion, newIcons, updatedIcons, removedIcons) {
}

if (removedIcons.length > 0) {
releaseNotes += '\n# Removed Icons\n\n';
releaseNotes += `\n## ${removedIcons.length} removed ${removedIcons.length > 1 ? 'icons' : 'icon'}\n\n`;
for (let removedIcon of removedIcons.sort(sortAlphabetically)) {
const prs = prNumbersToString(removedIcon.prNumbers);
const authors = authorsToString(removedIcon.authors);
Expand Down
6 changes: 3 additions & 3 deletions test/create.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const expectedNotes = `_this Pull Request was automatically generated_
The new version will be: **v2.0.0**
# New Icons
## 6 new icons
- ACM (#513) (@mondeja)
- bar (#512) (@LitoMore)
Expand All @@ -17,7 +17,7 @@ The new version will be: **v2.0.0**
- Pokémon (#514) (@PeterShaggyNoble)
- WordPress (#510) (@fbernhart)
# Updated Icons
## 9 updated icons
- 1Password (#503) (@service-paradis)
- Abstract (#509) (@service-paradis)
Expand All @@ -29,7 +29,7 @@ The new version will be: **v2.0.0**
- Opera (#510) (@fbernhart)
- Postman (#506) (@LitoMore)
# Removed Icons
## 1 removed icon
- Foobar (#515) (@service-paradis)
`;
Expand Down

0 comments on commit dde8f33

Please sign in to comment.