Skip to content

Commit

Permalink
Merge pull request #781 from hmcts/ieuanb74-patch-3
Browse files Browse the repository at this point in the history
DTSPO-19297 Reverting changes
  • Loading branch information
ieuanb74 authored Oct 9, 2024
2 parents 8fd3b57 + 9ab0c9b commit 5b3deaf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/appgateway-auto-start.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
13 changes: 3 additions & 10 deletions scripts/common/common-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 5b3deaf

Please sign in to comment.