From 9ab0c9bdf6fdaf6a253fe975956bf5a35d46fc96 Mon Sep 17 00:00:00 2001 From: Ieuan Byers Date: Wed, 9 Oct 2024 08:44:58 +0100 Subject: [PATCH] Reverting changes --- .github/workflows/appgateway-auto-start.yaml | 4 ++-- scripts/common/common-functions.sh | 13 +++---------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/appgateway-auto-start.yaml b/.github/workflows/appgateway-auto-start.yaml index 0a99b019..2827039e 100644 --- a/.github/workflows/appgateway-auto-start.yaml +++ b/.github/workflows/appgateway-auto-start.yaml @@ -4,7 +4,7 @@ on: schedule: - cron: "30 5 * * 1-5" # Every weekday at 6:30am BST env: - DEV_ENV: "true" + DEV_ENV: ${{ secrets.DEV_ENV }} permissions: id-token: write jobs: @@ -62,5 +62,5 @@ jobs: run: sleep 300 - name: App Gateway Auto start status check - # if: env.DEV_ENV != 'true' + if: env.DEV_ENV != 'true' run: ./scripts/appgateway/appgw_status.sh start ${{ secrets.SHUTDOWN_NOTIFICATIONS_WEBHOOK }} diff --git a/scripts/common/common-functions.sh b/scripts/common/common-functions.sh index ebea3825..f84926a1 100644 --- a/scripts/common/common-functions.sh +++ b/scripts/common/common-functions.sh @@ -55,17 +55,10 @@ function auto_shutdown_notification() { # This silences the slack response message in logs. # Comment this line out if you are having issues with slack delivery and want to see responses in your terminal - # local silentResponse="-s -o /dev/null" + local silentResponse="-s -o /dev/null" - response=$(curl $silentResponse -X POST --data-urlencode "payload={\"username\": \"Auto Shutdown Notifications\", \"text\": \"$message\", \"icon_emoji\": \":tim-webster:\"}" ${notificationSlackWebhook} 2>&1) - exit_code=$? - - if [ $exit_code -ne 0 ]; then - echo "Error: $response" - exit $exit_code - else - echo "Success: $response" - fi + curl $silentResponse -X POST --data-urlencode "payload={\"username\": \"Auto Shutdown Notifications\", \"text\": \"$message\", \"icon_emoji\": \":tim-webster:\"}" \ + ${notificationSlackWebhook} } function get_current_date() {