API monitoring #5475
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: API monitoring | |
on: | |
schedule: | |
- cron: "1 * * * *" | |
jobs: | |
all: | |
runs-on: ubuntu-latest | |
steps: | |
- name: read models file | |
id: read | |
run: | | |
echo "./models.json" | |
cat ./models.json | |
- name: testing models | |
id: testing | |
run: | | |
KEYS=$(jq 'keys[]' "${{ steps.read.outputs.path }}") | |
for key in $KEYS; do | |
API_URL=$(jq -r ".[$key].api" "${{ steps.read.outputs.path }}") | |
HEADERS=$(jq -r ".[$key].headers[]" "${{ steps.read.outputs.path }}") | |
DATA=$(jq -r ".[$key].data" "${{ steps.read.outputs.path }}") | |
echo "You online?" | |
curl -X POST \ | |
"$API_URL" \ | |
-H "$HEADERS" \ | |
-d "$DATA" | |
done |