From e63744767da6cb86be4b34ce00a19b6f2a874508 Mon Sep 17 00:00:00 2001
From: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Date: Thu, 11 May 2023 12:53:59 -0600
Subject: [PATCH] [CI] Fix syntax error in slack notifications script (#30660)

---
 .github/workflows/rerun-workflows.yml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/rerun-workflows.yml b/.github/workflows/rerun-workflows.yml
index d892ebd431f..ab998ad9371 100644
--- a/.github/workflows/rerun-workflows.yml
+++ b/.github/workflows/rerun-workflows.yml
@@ -30,10 +30,6 @@ jobs:
             const MAX_ATTEMPTS = 2;
             const ATTEMPT = ${{ github.event.workflow_run.run_attempt }};
 
-            const author = `@${context.actor}`;
-            const breaking_commit = context.sha;
-            const branch = context.ref;
-
             if (ATTEMPT <= MAX_ATTEMPTS) {
               github.rest.actions.reRunWorkflowFailedJobs({
                 owner: context.repo.owner,
@@ -42,9 +38,13 @@ jobs:
               });
             } else {
               // notify slack of repeated failure
-              const WebClient = require('@slack/web-api');
+              const { WebClient } = require('@slack/web-api');
               const slack = new WebClient('${{ secrets.SLACK_BOT_TOKEN }}');
 
+              const author = `@${context.actor}`;
+              const breaking_commit = context.sha;
+              const branch = context.ref;
+
               await slack.chat.postMessage({
                 channel: 'engineering-ci',
                 blocks: [
-- 
GitLab