Previously, the commit SHAs and PR numbers referenced in the generated `CHANGELOG.md` were not automatically converted to links in the GitHub UI (as happens for release notes and issue/PR comments). This made it less straight-forward for someone reading the changelog to get to the commit/PR corresponding to a change. This commit updates the tooling that generates the changelog to convert the commit SHA and the corresponding PR number (referenced at the end of the commit message header) to links. PR Close #42732
93 lines
1.7 KiB
TypeScript
93 lines
1.7 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
export default `
|
|
<a name="<%- version %>"></a>
|
|
# <%- version %><% if (title) { %> "<%- title %>"<% } %> (<%- dateStamp %>)
|
|
|
|
<%_
|
|
const commitsInChangelog = commits.filter(includeInReleaseNotes());
|
|
for (const group of asCommitGroups(commitsInChangelog)) {
|
|
_%>
|
|
|
|
### <%- group.title %>
|
|
| Commit | Description |
|
|
| -- | -- |
|
|
<%_
|
|
for (const commit of group.commits) {
|
|
_%>
|
|
| <%- commitToLink(commit) %> | <%- replaceCommitHeaderPullRequestNumber(commit.header) %> |
|
|
<%_
|
|
}
|
|
}
|
|
_%>
|
|
|
|
<%_
|
|
const breakingChanges = commits.filter(contains('breakingChanges'));
|
|
if (breakingChanges.length) {
|
|
_%>
|
|
## Breaking Changes
|
|
|
|
<%_
|
|
for (const group of asCommitGroups(breakingChanges)) {
|
|
_%>
|
|
### <%- group.title %>
|
|
|
|
<%_
|
|
for (const commit of group.commits) {
|
|
_%>
|
|
<%- commit.breakingChanges[0].text %>
|
|
|
|
<%_
|
|
}
|
|
}
|
|
}
|
|
_%>
|
|
|
|
<%_
|
|
const deprecations = commits.filter(contains('deprecations'));
|
|
if (deprecations.length) {
|
|
_%>
|
|
## Deprecations
|
|
<%_
|
|
for (const group of asCommitGroups(deprecations)) {
|
|
_%>
|
|
### <%- group.title %>
|
|
|
|
<%_
|
|
for (const commit of group.commits) {
|
|
_%>
|
|
<%- commit.deprecations[0].text %>
|
|
<%_
|
|
}
|
|
}
|
|
}
|
|
_%>
|
|
|
|
<%_
|
|
const botsAuthorName = ['dependabot[bot]', 'Renovate Bot'];
|
|
const authors = commits
|
|
.filter(unique('author'))
|
|
.map(c => c.author)
|
|
.filter(a => !botsAuthorName.includes(a))
|
|
.sort();
|
|
if (authors.length === 1) {
|
|
_%>
|
|
## Special Thanks:
|
|
<%- authors[0]%>
|
|
<%_
|
|
}
|
|
if (authors.length > 1) {
|
|
_%>
|
|
## Special Thanks:
|
|
<%- authors.slice(0, -1).join(', ') %> and <%- authors.slice(-1)[0] %>
|
|
<%_
|
|
}
|
|
_%>
|
|
`;
|