Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lib/prepare_security.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@ export default class PrepareSecurityRelease extends SecurityRelease {
// For now, close the ones with Security Release label
await this.closePRWithLabel('Security Release');

if (vulnerabilityJSON.buildIssue) {
this.cli.info('Commenting on nodejs/build issue');
await this.req.commentIssue(
vulnerabilityJSON.buildIssue,
'Security release is out'
);
}

if (vulnerabilityJSON.dockerIssue) {
this.cli.info('Commenting on nodejs/docker-node issue');
await this.req.commentIssue(
vulnerabilityJSON.dockerIssue,
'Security release is out'
);
}

const updateFolder = await this.cli.prompt(
`Would you like to update the next-security-release folder to ${
vulnerabilityJSON.releaseDate}?`,
Expand Down
17 changes: 17 additions & 0 deletions lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,23 @@ export default class Request {
return this.json(url, options);
}

async commentIssue(fullUrl, comment) {
const commentUrl = fullUrl.replace('https://github.com/', 'https://api.github.com/repos/') +
'/comments';
const options = {
method: 'POST',
headers: {
Authorization: `Basic ${this.credentials.github}`,
'User-Agent': 'node-core-utils',
Accept: 'application/vnd.github+json'
},
body: JSON.stringify({
body: comment,
})
};
return this.json(commentUrl, options);
}

async getPullRequest(fullUrl) {
const prUrl = fullUrl.replace('https://github.com/', 'https://api.github.com/repos/').replace('pull', 'pulls');
const options = {
Expand Down
Loading