From 1b8e4a763d5d38cdb77ff6943d2db590f96e1ef0 Mon Sep 17 00:00:00 2001 From: Bruno Logerfo Date: Fri, 25 Oct 2019 12:14:52 -0300 Subject: [PATCH] dist --- dist/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 95e6f3f9..d0e8ef87 100644 --- a/dist/index.js +++ b/dist/index.js @@ -450,7 +450,7 @@ async function run() { case "check_run": if (auto_merge) { - context.payload.check_run.pull_requests.forEach(async function (element) { + for (const element of context.payload.check_run.pull_requests) { const pullResponse = await client.pulls.get({ owner, pull_number: element.number, @@ -464,7 +464,7 @@ async function run() { else { core.info(`Pull request #${element.number} does not have the label ${label}. Skipping...`); } - }); + } } else { core.info("Auto merge is disabled. You should remove the `check_run` event from the action configuration. Skipping..."); @@ -475,6 +475,7 @@ async function run() { catch (err) { //Even if it's a valid situation, we want to fail the action in order to be able to find the issue and fix it. core.setFailed(err.message); + core.debug(JSON.stringify(err)); } } @@ -496,7 +497,7 @@ async function push() { repo, state: "open", }); - core.debug(pulls.data); + core.debug(JSON.stringify(pulls.data)); let pull_number; if (pulls.data.length == 1) { const data = pulls.data[0]; @@ -524,7 +525,7 @@ async function push() { issue_number: pull_number, labels: [label], owner, - repo + repo, }); core.info(`Label ${label} added to #${pull_number}.`); core.debug(JSON.stringify(labelsResponse.data));