From 280ddb3b47c90694e8c40e02db469198d2f580e3 Mon Sep 17 00:00:00 2001 From: Popov Aleksey Date: Thu, 7 Dec 2023 10:45:46 +0200 Subject: [PATCH] fix: added awaiting for creating issues --- .github/scripts/security-checker.mjs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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) {