From 02239df030981e9374fa66ba15a4a6397a4f2969 Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Thu, 12 May 2022 19:32:51 +0000 Subject: [PATCH] fix(github-actions): properly spread the requested_teams values for pending reviews Previously the requested_teams was not spread resulting in an array like [[]] instead of [] when no reviews are pending. --- github-actions/post-approval-changes/lib/main.ts | 2 +- github-actions/post-approval-changes/main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/github-actions/post-approval-changes/lib/main.ts b/github-actions/post-approval-changes/lib/main.ts index caa382dc4..fb9d1066f 100644 --- a/github-actions/post-approval-changes/lib/main.ts +++ b/github-actions/post-approval-changes/lib/main.ts @@ -43,7 +43,7 @@ async function run(): Promise { return; } - if ([...pr.requested_reviewers, pr.requested_teams].length > 0) { + if ([...pr.requested_reviewers, ...pr.requested_teams].length > 0) { core.info('Skipping check as there are still pending reviews.'); return; } diff --git a/github-actions/post-approval-changes/main.js b/github-actions/post-approval-changes/main.js index 8695d743c..ca96c2b5d 100644 --- a/github-actions/post-approval-changes/main.js +++ b/github-actions/post-approval-changes/main.js @@ -15279,7 +15279,7 @@ async function run() { core.info("PR author is a googler, skipping as post approval changes are allowed."); return; } - if ([...pr.requested_reviewers, pr.requested_teams].length > 0) { + if ([...pr.requested_reviewers, ...pr.requested_teams].length > 0) { core.info("Skipping check as there are still pending reviews."); return; }