diff --git a/.github/scripts/security-checker.mjs b/.github/scripts/security-checker.mjs index cbaf30f..ec5f088 100644 --- a/.github/scripts/security-checker.mjs +++ b/.github/scripts/security-checker.mjs @@ -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 () { @@ -127,11 +127,11 @@ 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, @@ -139,22 +139,22 @@ class SecurityChecker { 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) {