Commit 5aea77fc by Torkel Ödegaard Committed by GitHub

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

* Automation: Updated cherrypick task to show merge sha

* Fixed changelog milestone filtering
parent c2231854
...@@ -14,21 +14,21 @@ const changelogTaskRunner: TaskRunner<ChangelogOptions> = async ({ milestone }) ...@@ -14,21 +14,21 @@ const changelogTaskRunner: TaskRunner<ChangelogOptions> = async ({ milestone })
timeout: 10000, 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', { const res = await client.get('/issues', {
params: { params: {
state: 'closed', state: 'closed',
per_page: 100, per_page: 100,
labels: 'add to changelog', labels: 'add to changelog',
milestone: milestone,
}, },
}); });
const issues = res.data.filter(item => { const issues = res.data;
if (!item.milestone) {
console.log('Item missing milestone', item.number);
return false;
}
return item.milestone.title === milestone;
});
const bugs = _.sortBy( const bugs = _.sortBy(
issues.filter(item => { issues.filter(item => {
......
...@@ -27,13 +27,10 @@ const cherryPickRunner: TaskRunner<CherryPickOptions> = async () => { ...@@ -27,13 +27,10 @@ const cherryPickRunner: TaskRunner<CherryPickOptions> = async () => {
continue; 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 issueDetails = await client.get(item.pull_request.url);
const commits = await client.get(issueDetails.data.commits_url); console.log(`\tMerge sha: ${issueDetails.data.merge_commit_sha}`);
for (const commit of commits.data) {
console.log(commit.commit.message + ' sha: ' + commit.sha);
}
} }
}; };
......
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