Check Updates #2
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: 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 |