-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (40 loc) · 1.3 KB
/
archive-top-measurements.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
on:
schedule:
- cron: "0 13,14 * * *" # Once per day + one retry
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/slack-github-action@v1.27.0
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 }}