Skip to content

try getting yesterday's date #7

try getting yesterday's date

try getting yesterday's date #7

on:
schedule:
- cron: "0 12 * * *" # Once per day
push:
jobs:
archive:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
- id: file
run: echo "file=`date -d \"yesterday 12:00\" '+%Y-%m-%d'`.json" >> $GITHUB_OUTPUT
- run: |
curl --fail "https://stats.filspark.com/participants/top-measurements?from=yesterday&to=yesterday" > ${{ steps.file.outputs.file }}
- uses: EndBug/add-and-commit@v9
with:
add: ${{ steps.file.outputs.file }}
commit: --signoff
message: ${{ steps.file.outputs.file }}
push: origin main
# - if: failure()
# uses: slackapi/[email protected]
# with:
# channel-id: alerts
# payload: |
# {
# "text": "Top measurements archival failed",
# "blocks": [
# {
# "type": "section",
# "text": {
# "type": "mrkdwn",
# "text": ":warning: *<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Top measurements archival failed>*"
# }
# }
# ]
# }
# env:
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}