Skip to content

Commit

Permalink
fix: added awaiting for creating issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksey28 committed Dec 7, 2023
1 parent 7c81358 commit 280ddb3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/scripts/security-checker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class SecurityChecker {
this.alertDictionary = this.createAlertDictionary(existedIssues);

await this.closeSpoiledIssues();
this.createDependabotlIssues(dependabotAlerts);
this.createCodeqlIssues(codeqlAlerts);
await this.createDependabotlIssues(dependabotAlerts);
await this.createCodeqlIssues(codeqlAlerts);
}

async getDependabotAlerts () {
Expand Down Expand Up @@ -127,34 +127,34 @@ class SecurityChecker {
}

async createDependabotlIssues (dependabotAlerts) {
dependabotAlerts.forEach(alert => {
for (const alert of dependabotAlerts) {
if (!this.needCreateIssue(alert))
return;

this.createIssue({
await this.createIssue({
labels: [LABELS.dependabot, LABELS.security, alert.dependency.scope],
originRepo: this.context.repo,
summary: alert.security_advisory.summary,
description: alert.security_advisory.description,
link: alert.html_url,
issuePackage: alert.dependency.package.name,
});
});
}
}

async createCodeqlIssues (codeqlAlerts) {
codeqlAlerts.forEach(alert => {
for (const alert of codeqlAlerts) {
if (!this.needCreateIssue(alert))
return;

this.createIssue({
await this.createIssue({
labels: [LABELS.codeql, LABELS.security],
originRepo: this.context.repo,
summary: alert.rule.description,
description: alert.most_recent_instance.message.text,
link: alert.html_url,
});
});
}
}

needCreateIssue (alert) {
Expand Down

0 comments on commit 280ddb3

Please sign in to comment.