Skip to content

API Keep-Alive Ping #253

API Keep-Alive Ping

API Keep-Alive Ping #253

Workflow file for this run

name: API Keep-Alive Ping
on:
schedule:
- cron: '0 */3 * * *'
workflow_dispatch:
jobs:
ping-api:
runs-on: ubuntu-latest
steps:
- name: Ping API and check response
id: call
run: |
response=$(curl -s -w "%{http_code}" -X POST \
"https://chakaramapi.azurewebsites.net/api/ClipSync/WakeUp" \
-H "accept: */*" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${{ secrets.WAKEUP_API_KEY }}" \
-d '{"aliveId": "c81d999a-dd2a-4903-b660-b27cc5883afa"}')
http_status="${response: -3}"
body="${response:0:-3}"
echo "HTTP status: $http_status"
echo "Response body: $body"
if [ "$http_status" != "200" ]; then
echo "Request failed with status $http_status"
exit 1
fi
- name: Success message
if: success()
run: echo "API keep-alive ping succeeded."