Skip to content

Commit

Permalink
fix: if no changes dont update
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-ippolito committed Apr 19, 2024
1 parent 49c878a commit 2fe2b9b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/security_blog.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {
import auth from './auth.js';
import Request from './request.js';

const kChanged = Symbol('changed');

export default class SecurityBlog {
repository = NEXT_SECURITY_RELEASE_REPOSITORY;
req;
Expand Down Expand Up @@ -106,6 +108,9 @@ export default class SecurityBlog {

fs.writeFileSync(pathPreRelease, updatedContent);
cli.ok(`Post-release announcement file updated at ${pathPreRelease}`);

// if the vulnerabilities.json has been changed, update the file
if (!content[kChanged]) return;
this.updateVulnerabilitiesJSON(content);
}

Expand Down Expand Up @@ -225,6 +230,7 @@ export default class SecurityBlog {
defaultAnswer: 'TBD'
});
report.cve_ids = [cveId];
content[kChanged] = true;
}
template += `\n## ${report.title} (${cveId}) - (${report.severity.rating})\n\n`;
if (!report.summary) {
Expand All @@ -236,6 +242,7 @@ export default class SecurityBlog {

if (fetchIt) {
report.summary = await getSummary(report.id, this.req);
content[kChanged] = true;
}

if (!report.summary) {
Expand Down

0 comments on commit 2fe2b9b

Please sign in to comment.