From 9b33a4ef0c79058ac90d3e93700ad8929d7362e8 Mon Sep 17 00:00:00 2001 From: Okan Sahin <39759830+mokimo@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:18:12 +0200 Subject: [PATCH] Fix the merge to stage process (#3068) * Fix the merge to stage process * Remove logging the body --- .github/workflows/merge-to-stage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-to-stage.js b/.github/workflows/merge-to-stage.js index 6fb721f3fe..e615c96538 100644 --- a/.github/workflows/merge-to-stage.js +++ b/.github/workflows/merge-to-stage.js @@ -236,7 +236,7 @@ const main = async (params) => { const stageToMainPR = await getStageToMainPR(); console.log('has Stage to Main PR:', !!stageToMainPR); if (stageToMainPR) body = stageToMainPR.body; - existingPRCount = body.match(/https:\/\/github\.com\/adobecom\/milo\/pull\/\d+/g).length; + existingPRCount = body.match(/https:\/\/github\.com\/adobecom\/milo\/pull\/\d+/g)?.length || 0; console.log(`Number of PRs already in the batch: ${existingPRCount}`); if (mergeLimitExceeded()) return console.log(`Maximum number of '${MAX_MERGES}' PRs already merged. Stopping execution`);