forked from Scottcjn/Rustchain
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (45 loc) · 1.54 KB
/
mining-status.yml
File metadata and controls
51 lines (45 loc) · 1.54 KB
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
41
42
43
44
45
46
47
48
49
50
51
name: RustChain Mining Status Badge
on:
schedule:
- cron: '*/15 * * * *'
workflow_dispatch:
inputs:
wallet:
description: 'RustChain wallet for badge endpoint'
required: false
default: 'frozen-factorio-ryan'
jobs:
update-badge:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Verify badge endpoint
run: |
WALLET="${{ github.event.inputs.wallet || 'frozen-factorio-ryan' }}"
RESPONSE=$(curl -s --fail --max-time 10 "https://rustchain.org/api/badge/${WALLET}" || echo '{}')
SCHEMA=$(echo "$RESPONSE" | jq -r '.schemaVersion // empty' 2>/dev/null)
if [ "$SCHEMA" = "1" ]; then
echo "Badge endpoint healthy"
echo "$RESPONSE" | jq .
else
echo "Badge endpoint not deployed or unreachable yet"
echo "Response: $RESPONSE"
fi
- name: Update mining badge in README
uses: ./.github/actions/mining-status-badge
with:
wallet: ${{ github.event.inputs.wallet || 'frozen-factorio-ryan' }}
readme-path: README.md
badge-style: flat-square
- name: Commit badge update
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add README.md
git diff --cached --quiet || (
git commit -m "docs: refresh RustChain mining status badge" && \
git push
)