From e402b1d59a5d3dd3b8179d116a933a5c57db3c68 Mon Sep 17 00:00:00 2001 From: Joshua Taylor Keays <128968711+berlintay@users.noreply.github.com> Date: Fri, 9 Aug 2024 19:15:02 -0300 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9d5362f..88e6d40 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,3 +34,20 @@ jobs: --data-urlencode "From=${TWILIO_PHONE_NUMBER}" \ --data-urlencode "To=${TO_PHONE_NUMBER}" \ -u "${TWILIO_ACCOUNT_SID}:${TWILIO_AUTH_TOKEN}" + + - name: Notify via Pushover + if: always() # Always run this step + env: + PUSHOVER_USER_KEY: ${{ secrets.PUSHOVER_USER_KEY }} + PUSHOVER_API_TOKEN: ${{ secrets.PUSHOVER_API_TOKEN }} + run: | + if [ "$status" = "down" ]; then + message="Website is down!" + else + message="Website is up and running." + fi + curl -s \ + --form-string "token=${PUSHOVER_API_TOKEN}" \ + --form-string "user=${PUSHOVER_USER_KEY}" \ + --form-string "message=${message}" \ + https://api.pushover.net/1/messages.json