From cafc0737d6df434feed54b04e6e2324af69ce8ba Mon Sep 17 00:00:00 2001 From: Piotr Macha Date: Tue, 18 Jun 2024 11:14:16 +0200 Subject: [PATCH] ci: fix CTest bot --- .github/scripts/build-ctest-review.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/scripts/build-ctest-review.js b/.github/scripts/build-ctest-review.js index ca0bab9..a7d6df2 100644 --- a/.github/scripts/build-ctest-review.js +++ b/.github/scripts/build-ctest-review.js @@ -5,16 +5,18 @@ module.exports = async ({github, context, pull_number, status, log}) => { repo: context.repo.repo, }); - reviews.find(r => r.user.login ==='github-actions' && r.state === 'COMMENTED').forEach(r => { - github.rest.pulls.dismissReview({ - pull_number: pull_number, - owner: context.repo.owner, - repo: context.repo.repo, - review_id: r.id - }); - }); + for (let review of reviews) { + if (review.user.login === 'github-actions' && review.state === 'COMMENTED') { + await github.rest.pulls.dismissReview({ + pull_number: pull_number, + owner: context.repo.owner, + repo: context.repo.repo, + review_id: review.id + }); + } + } - github.rest.pulls.createReview({ + await github.rest.pulls.createReview({ pull_number: pull_number, owner: context.repo.owner, repo: context.repo.repo,