Automation: Updates to yarn cli cherrypick & changelog tasks (#16357)

* Automation: Updated cherrypick task to show merge sha

* Fixed changelog milestone filtering
This commit is contained in:
Torkel Ödegaard 2019-04-03 09:50:24 +02:00 committed by GitHub
parent c2231854fd
commit 5aea77fc95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 13 deletions

View File

@ -14,21 +14,21 @@ const changelogTaskRunner: TaskRunner<ChangelogOptions> = async ({ milestone })
timeout: 10000,
});
if (!/^\d+$/.test(milestone)) {
console.log('Use milestone number not title, find number in milestone url');
return;
}
const res = await client.get('/issues', {
params: {
state: 'closed',
per_page: 100,
labels: 'add to changelog',
milestone: milestone,
},
});
const issues = res.data.filter(item => {
if (!item.milestone) {
console.log('Item missing milestone', item.number);
return false;
}
return item.milestone.title === milestone;
});
const issues = res.data;
const bugs = _.sortBy(
issues.filter(item => {

View File

@ -27,13 +27,10 @@ const cherryPickRunner: TaskRunner<CherryPickOptions> = async () => {
continue;
}
console.log(item.number + ' closed_at ' + item.closed_at + ' ' + item.html_url);
console.log(`${item.title} (${item.number}) closed_at ${item.closed_at}`);
console.log(`\tURL: ${item.closed_at} ${item.html_url}`);
const issueDetails = await client.get(item.pull_request.url);
const commits = await client.get(issueDetails.data.commits_url);
for (const commit of commits.data) {
console.log(commit.commit.message + ' sha: ' + commit.sha);
}
console.log(`\tMerge sha: ${issueDetails.data.merge_commit_sha}`);
}
};