Update monitor.yml
This commit is contained in:
parent
07bc9131ee
commit
368291eb2d
16
.github/workflows/monitor.yml
vendored
16
.github/workflows/monitor.yml
vendored
@ -2,7 +2,7 @@ name: Monitor Lab URLs
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "* * * * *"
|
- cron: "*/5 * * * *" # מריץ כל 5 דקות (שנה לפי הצורך)
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -11,20 +11,26 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Check Woodpecker URL
|
- name: Check Woodpecker URL
|
||||||
run: |
|
run: |
|
||||||
STATUS=$(curl -s -o /dev/null -w "%{http_code}" https://woodpecker.dvirlabs.com)
|
URL="https://woodpecker.dvirlabs.com"
|
||||||
|
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$URL")
|
||||||
|
TIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||||
|
|
||||||
if [[ "$STATUS" == "502" ]]; then
|
if [[ "$STATUS" == "502" ]]; then
|
||||||
curl -s \
|
curl -s \
|
||||||
--form-string "token=${{ secrets.PUSHOVER_TOKEN }}" \
|
--form-string "token=${{ secrets.PUSHOVER_TOKEN }}" \
|
||||||
--form-string "user=${{ secrets.PUSHOVER_USER }}" \
|
--form-string "user=${{ secrets.PUSHOVER_USER }}" \
|
||||||
--form-string "message=⚠️ Woodpecker is down (502)" \
|
--form-string "title=🚨 Woodpecker Alert" \
|
||||||
|
--form-string "message=⚠️ $URL is down (502) at $TIME" \
|
||||||
https://api.pushover.net/1/messages.json
|
https://api.pushover.net/1/messages.json
|
||||||
|
exit 1
|
||||||
elif [[ "$STATUS" == "404" ]]; then
|
elif [[ "$STATUS" == "404" ]]; then
|
||||||
curl -s \
|
curl -s \
|
||||||
--form-string "token=${{ secrets.PUSHOVER_TOKEN }}" \
|
--form-string "token=${{ secrets.PUSHOVER_TOKEN }}" \
|
||||||
--form-string "user=${{ secrets.PUSHOVER_USER }}" \
|
--form-string "user=${{ secrets.PUSHOVER_USER }}" \
|
||||||
--form-string "message=❌ Woodpecker not found (404)" \
|
--form-string "title=🚨 Woodpecker Alert" \
|
||||||
|
--form-string "message=❌ $URL returned 404 at $TIME" \
|
||||||
https://api.pushover.net/1/messages.json
|
https://api.pushover.net/1/messages.json
|
||||||
|
exit 1
|
||||||
else
|
else
|
||||||
echo "✅ All good: $STATUS"
|
echo "✅ Woodpecker is up: $STATUS"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user