Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update release note format #86

Merged
merged 2 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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