Commit 3fd85051 by Sofia Papagiannaki Committed by GitHub

Update changelog generation to ignore not merged pull requests (#21641)

parent a734cd36
...@@ -66,7 +66,20 @@ const changelogTaskRunner: TaskRunner<ChangelogOptions> = useSpinner<ChangelogOp ...@@ -66,7 +66,20 @@ const changelogTaskRunner: TaskRunner<ChangelogOptions> = useSpinner<ChangelogOp
}, },
}); });
const issues = res.data; const mergedIssues = [];
for (const item of res.data) {
if (!item.pull_request) {
// it's an issue, not pull request
mergedIssues.push(item);
continue;
}
const isMerged = await client.get(item.pull_request.url + '/merge');
if (isMerged.status === 204) {
mergedIssues.push(item);
}
}
const issues = _.sortBy(mergedIssues, 'title');
const toolkitIssues = issues.filter((item: any) => const toolkitIssues = issues.filter((item: any) =>
item.labels.find((label: any) => label.name === 'area/grafana/toolkit') item.labels.find((label: any) => label.name === 'area/grafana/toolkit')
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment