- recompile dist files

This commit is contained in:
Mike Penz
2020-10-29 12:09:31 +01:00
parent a1b4e555e4
commit fa6d5a8b8f
2 changed files with 15 additions and 35 deletions
Generated Vendored
+14 -34
View File
@@ -401,6 +401,7 @@ class PullRequests {
title: pr.data.title, title: pr.data.title,
htmlURL: pr.data.html_url, htmlURL: pr.data.html_url,
mergedAt: moment_1.default(pr.data.merged_at), mergedAt: moment_1.default(pr.data.merged_at),
mergeCommitSha: pr.data.merge_commit_sha,
author: pr.data.user.login, author: pr.data.user.login,
repoName: pr.data.base.repo.full_name, repoName: pr.data.base.repo.full_name,
labels: pr.data.labels.map(function (label) { labels: pr.data.labels.map(function (label) {
@@ -444,6 +445,7 @@ class PullRequests {
title: pr.title, title: pr.title,
htmlURL: pr.html_url, htmlURL: pr.html_url,
mergedAt: moment_1.default(pr.merged_at), mergedAt: moment_1.default(pr.merged_at),
mergeCommitSha: pr.merge_commit_sha,
author: pr.user.login, author: pr.user.login,
repoName: pr.base.repo.full_name, repoName: pr.base.repo.full_name,
labels: (_b = pr.labels) === null || _b === void 0 ? void 0 : _b.map(function (label) { labels: (_b = pr.labels) === null || _b === void 0 ? void 0 : _b.map(function (label) {
@@ -480,8 +482,10 @@ class PullRequests {
return sortPullRequests(mergedPRs, true); return sortPullRequests(mergedPRs, true);
}); });
} }
/**
* Filters out all commits which match the exclude pattern
*/
filterCommits(commits, excludeMergeBranches) { filterCommits(commits, excludeMergeBranches) {
const prRegex = /Merge pull request #(\d+)/;
const filteredCommits = []; const filteredCommits = [];
for (const commit of commits) { for (const commit of commits) {
if (excludeMergeBranches) { if (excludeMergeBranches) {
@@ -496,11 +500,6 @@ class PullRequests {
continue; continue;
} }
} }
const match = commit.summary.match(prRegex);
if (!match) {
continue;
}
commit.prNumber = Number.parseInt(match[1], 10);
filteredCommits.push(commit); filteredCommits.push(commit);
} }
return filteredCommits; return filteredCommits;
@@ -633,34 +632,15 @@ class ReleaseNotes {
core.info(`️ Retrieved ${pullRequests.length} merged PRs for ${owner}/${repo}`); core.info(`️ Retrieved ${pullRequests.length} merged PRs for ${owner}/${repo}`);
const prCommits = pullRequestsApi.filterCommits(commits, configuration.exclude_merge_branches || const prCommits = pullRequestsApi.filterCommits(commits, configuration.exclude_merge_branches ||
configuration_1.DefaultConfiguration.exclude_merge_branches); configuration_1.DefaultConfiguration.exclude_merge_branches);
core.info(`️ Retrieved ${prCommits.length} PR merge commits for ${owner}/${repo}`); core.info(`️ Retrieved ${prCommits.length} release commits for ${owner}/${repo}`);
const filteredPullRequests = []; // create array of commits for this release
const pullRequestsByNumber = {}; const releaseCommitHashes = prCommits.map(commmit => {
for (const pr of pullRequests) { return commmit.sha;
pullRequestsByNumber[pr.number] = pr; });
} // return only the pull requests associated with this release
for (const commit of prCommits) { return pullRequests.filter(pr => {
if (!commit.prNumber) { return releaseCommitHashes.includes(pr.mergeCommitSha);
continue; });
}
const prRef = `${owner}/${repo}#${commit.prNumber}`;
if (pullRequestsByNumber[commit.prNumber]) {
filteredPullRequests.push(pullRequestsByNumber[commit.prNumber]);
}
else if (fromDate.toISOString() === toDate.toISOString()) {
const pullRequest = yield pullRequestsApi.getSingle(owner, repo, commit.prNumber);
if (pullRequest) {
filteredPullRequests.push(pullRequest);
}
else {
core.warning(`⚠️ ${prRef} not found! Commit text: ${commit.summary}`);
}
}
else {
core.info(`${prRef} not in date range, excluding from changelog`);
}
}
return filteredPullRequests;
}); });
} }
} }
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long