Skip to content

Commit

Permalink
changelog: Remove duplicate PRs (#1999)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Jun 28, 2019
1 parent 1710fb0 commit 7c20807
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions resources/gen-changelog.js
Expand Up @@ -214,7 +214,7 @@ async function batchCommitInfo(commits) {
}

function commitsInfoToPRs(commits) {
const prs = [];
const prs = {};
for (const commit of commits) {
const associatedPRs = commit.associatedPullRequests.nodes.filter(
pr => pr.repository.nameWithOwner === 'graphql/graphql-js',
Expand Down Expand Up @@ -243,16 +243,17 @@ function commitsInfoToPRs(commits) {
`PR #${pr.number} has conflicting labels: ` + labels.join('\n'),
);
}
prs.push({

prs[pr.number] = {
number: pr.number,
title: pr.title,
url: pr.url,
author: pr.author,
label: labels[0],
});
};
}

return prs;
return Object.values(prs);
}

async function getCommitsInfo(commits) {
Expand Down

0 comments on commit 7c20807

Please sign in to comment.