Skip to content

Check Updates

Check Updates #2

Workflow file for this run

name: Check Updates
on:
schedule:
- cron: "0 20 * * *"
jobs:
check_updates:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Fetch JSON data
run: |
curl -o optimalfraction.json https://charts-core.peercoinexplorer.net/optimalfraction.json
- name: Check if yesterday is included
run: |
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