Skip to content

Commit

Permalink
chore: fix release issue (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored Apr 29, 2022
1 parent be7400b commit b1eed94
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 26 deletions.
39 changes: 27 additions & 12 deletions scripts/release/__tests__/create-release-issue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,22 +265,37 @@ describe('create release issue', () => {

expect(
getSkippedCommitsText({
commitsWithoutLanguageScope: ['abcdefg fix: something'],
commitsWithUnknownLanguageScope: ['abcdef2 fix(pascal): what'],
commitsWithoutLanguageScope: [
'abcdefg fix: something',
'abcdefg fix: somethin2',
],

commitsWithUnknownLanguageScope: [
'abcdef2 fix(pascal): what',
'abcdef2 fix(pascal): what is that',
],
})
).toMatchInlineSnapshot(`
"<p></p>
<p>It doesn't mean these commits are being excluded from the release. It means they're not taken into account when the release process figured out the next version number, and updated the changelog.</p>
"</p>
<p>It doesn't mean these commits are being excluded from the release. It means they're not taken into account when the release process figured out the next version number, and updated the changelog.</p>
<details>
<summary>
<i>Commits without language scope:</i>
</summary>
- abcdefg fix: something
- abcdefg fix: somethin2
</details>
<p>Commits without language scope:</p>
<ul>
<li>abcdefg fix: something</li>
</ul>
<details>
<summary>
<i>Commits with unknown language scope:</i>
</summary>
<p>Commits with unknown language scope:</p>
<ul>
<li>abcdef2 fix(pascal): what</li>
</ul>"
- abcdef2 fix(pascal): what
- abcdef2 fix(pascal): what is that
</details>"
`);
});
});
34 changes: 20 additions & 14 deletions scripts/release/create-release-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,24 @@ export function getSkippedCommitsText({
return '_(None)_';
}

return `<p></p>
<p>${TEXT.skippedCommitsDesc}</p>
<p>Commits without language scope:</p>
<ul>
${commitsWithoutLanguageScope.map((commit) => `<li>${commit}</li>`)}
</ul>
<p>Commits with unknown language scope:</p>
<ul>
${commitsWithUnknownLanguageScope.map((commit) => `<li>${commit}</li>`)}
</ul>`;
return `</p>
<p>${TEXT.skippedCommitsDesc}</p>
<details>
<summary>
<i>Commits without language scope:</i>
</summary>
${commitsWithoutLanguageScope.map((commit) => `- ${commit}`).join('\n')}
</details>
<details>
<summary>
<i>Commits with unknown language scope:</i>
</summary>
${commitsWithUnknownLanguageScope.map((commit) => `- ${commit}`).join('\n')}
</details>`;
}

export function parseCommit(commit: string): Commit {
Expand Down Expand Up @@ -278,13 +284,13 @@ async function createReleaseIssue(): Promise<void> {
TEXT.header,
TEXT.versionChangeHeader,
versionChanges,
TEXT.skippedCommitsHeader,
skippedCommits,
TEXT.descriptionVersionChanges,
TEXT.indenpendentVersioning,
TEXT.changelogHeader,
TEXT.changelogDescription,
changelogs,
TEXT.skippedCommitsHeader,
skippedCommits,
TEXT.approvalHeader,
TEXT.approval,
].join('\n\n');
Expand Down

0 comments on commit b1eed94

Please sign in to comment.