angular-cli/scripts/templates/changelog-breaking-changes.ejs
2019-03-29 14:37:03 -07:00

28 lines
759 B
Plaintext

<%
const breakingChanges = [];
for (const commit of commits) {
const breakingChange = commit.notes.find(c => c.title === 'BREAKING CHANGE');
if (breakingChange) {
breakingChanges.push({
scope: commit.scope,
subject: commit.subject,
shortSha: commit.hash.slice(0, 7),
hash: commit.hash,
breakingText: breakingChange.text,
});
}
}
if (breakingChanges.length) {
%>
# Breaking Changes
<% for (const commit of breakingChanges) { %>
<h3>
<%= `${commit.scope ? commit.scope + ': ' : ''}` %><%= commit.subject %> (<a href="https://github.com/angular/angular-cli/commit/<%= commit.hash %>"><%= commit.shortSha %></a>)
</h3>
<%= commit.breakingText %>
<% }%>
<% }%>