Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions .github/workflows/daily-balance-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
jobs:
snapshot-balances:
runs-on: ubuntu-latest
timeout-minutes: 300 # 5 hours timeout (GitHub Actions max is 6 hours)

steps:
- name: Checkout repository
Expand All @@ -27,22 +28,31 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Run balance snapshots
run: node scripts/balance-snapshots.js
- name: Install script dependencies
run: |
cd scripts
npm install

- name: Run batch snapshot orchestration
run: |
cd scripts
npm start
env:
API_BASE_URL: "https://multisig.meshjs.dev"
SNAPSHOT_AUTH_TOKEN: ${{ secrets.SNAPSHOT_AUTH_TOKEN }}
BATCH_SIZE: 3
DELAY_BETWEEN_REQUESTS: 3
DELAY_BETWEEN_BATCHES: 15
BATCH_SIZE: 10
DELAY_BETWEEN_BATCHES: 5
MAX_RETRIES: 3
REQUEST_TIMEOUT: 30

- name: Notify on failure
if: failure()
# Send failure notification
run: |
echo "❌ Daily balance snapshot job failed"
# Optional: Send failure notification
# curl -X POST -H 'Content-type: application/json' \
# --data "{\"text\":\"❌ Daily balance snapshots failed. Check the GitHub Actions logs.\"}" \
# ${{ secrets.DISCORD_WEBHOOK_URL }}
if [ -n "${{ secrets.SNAPSHOT_ERROR_DISCORD_WEBHOOK_URL }}" ]; then
curl -X POST -H 'Content-type: application/json' \
--data "{\"text\":\"❌ Daily balance snapshots failed. Check the GitHub Actions logs.\"}" \
${{ secrets.SNAPSHOT_ERROR_DISCORD_WEBHOOK_URL }} || echo "Failed to send Discord notification"
else
echo "SNAPSHOT_ERROR_DISCORD_WEBHOOK_URL not configured, skipping notification"
fi
272 changes: 0 additions & 272 deletions scripts/balance-snapshots.js

This file was deleted.

Loading