Skip to content

Check Updates

Check Updates #4

Workflow file for this run

name: Check Updates
on:
schedule:
- cron: "0 20 * * *"
jobs:
check_updates:
runs-on: ubuntu-latest
steps:
- name: Check if yesterday is included
run: |
curl -H "Cache-Control: no-cache" -o optimalfraction.json https://charts-core.peercoinexplorer.net/optimalfraction.json
jq empty optimalfraction.json || { echo "Invalid JSON"; exit 1; }
TODAY=$(date -u +"%Y-%m-%d")
YESTERDAY=$(date -u -d "$TODAY - 1 day" +"%Y-%m-%d")
if grep -q "$YESTERDAY" optimalfraction.json; then
echo "Yesterday ($YESTERDAY) is included in the JSON data."
else
echo "Yesterday ($YESTERDAY) is NOT included in the JSON data."
exit 1
fi