mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
parent
5befcc58f4
commit
7e43fce47b
1 changed files with 30 additions and 27 deletions
|
@ -58,33 +58,36 @@ async function ensurePr(upgrades) {
|
|||
upgrade.changeLogToVersion
|
||||
);
|
||||
// Store changelog markdown for backwards compatibility
|
||||
config.changelog = config.changelog || changelogHelper.getMarkdown(logJSON);
|
||||
upgrade.repositoryUrl = logJSON.project.repository;
|
||||
upgrade.githubName = logJSON.project.github;
|
||||
upgrade.releases = [];
|
||||
logJSON.versions.forEach(version => {
|
||||
const release = Object.assign({}, version);
|
||||
release.date = version.date.toISOString().slice(0, 10);
|
||||
release.commits = [];
|
||||
if (release.changes) {
|
||||
release.changes.forEach(change => {
|
||||
const commit = Object.assign({}, change);
|
||||
delete commit.date;
|
||||
commit.shortSha = change.sha.slice(0, 7);
|
||||
commit.url = `${logJSON.project.repository}/commit/${change.sha}`;
|
||||
if (change.message) {
|
||||
commit.message = change.message.split('\n')[0];
|
||||
const re = /([\s(])#(\d+)([)\s]?)/g;
|
||||
commit.message = commit.message.replace(
|
||||
re,
|
||||
`$1[#$2](${upgrade.repositoryUrl}/issues/$2)$3`
|
||||
);
|
||||
}
|
||||
release.commits.push(commit);
|
||||
});
|
||||
}
|
||||
upgrade.releases.push(release);
|
||||
});
|
||||
if (logJSON) {
|
||||
config.changelog =
|
||||
config.changelog || changelogHelper.getMarkdown(logJSON);
|
||||
upgrade.repositoryUrl = logJSON.project.repository;
|
||||
upgrade.githubName = logJSON.project.github;
|
||||
upgrade.releases = [];
|
||||
logJSON.versions.forEach(version => {
|
||||
const release = Object.assign({}, version);
|
||||
release.date = version.date.toISOString().slice(0, 10);
|
||||
release.commits = [];
|
||||
if (release.changes) {
|
||||
release.changes.forEach(change => {
|
||||
const commit = Object.assign({}, change);
|
||||
delete commit.date;
|
||||
commit.shortSha = change.sha.slice(0, 7);
|
||||
commit.url = `${logJSON.project.repository}/commit/${change.sha}`;
|
||||
if (change.message) {
|
||||
commit.message = change.message.split('\n')[0];
|
||||
const re = /([\s(])#(\d+)([)\s]?)/g;
|
||||
commit.message = commit.message.replace(
|
||||
re,
|
||||
`$1[#$2](${upgrade.repositoryUrl}/issues/$2)$3`
|
||||
);
|
||||
}
|
||||
release.commits.push(commit);
|
||||
});
|
||||
}
|
||||
upgrade.releases.push(release);
|
||||
});
|
||||
}
|
||||
config.upgrades.push(upgrade);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue