Skip to content

Merge pull request #43 from willyfromtheblock/dependabot/npm_and_yarn… #14

Merge pull request #43 from willyfromtheblock/dependabot/npm_and_yarn…

Merge pull request #43 from willyfromtheblock/dependabot/npm_and_yarn… #14

Workflow file for this run

name: Check Updates
on:
push:
branches:
- master
jobs:
check_updates:
runs-on: ubuntu-latest
steps:
- name: Fetch JSON data
env:
BYPASS_HEADER: ${{ secrets.BYPASS_HEADER }}
run: |
curl -v -H "x-test: $BYPASS_HEADER" -o optimalfraction.json https://charts-core.peercoinexplorer.net/optimalfraction.json
- name: Check if yesterday is included
run: |
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