forked from CircuitVerse/community-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (38 loc) · 1.11 KB
/
Copy pathupdate-github-stats.yml
File metadata and controls
48 lines (38 loc) · 1.11 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
name: Update GitHub Stats SVG
on:
# Run daily at midnight UTC
schedule:
- cron: '0 0 * * *'
# Run after leaderboard updates
workflow_run:
workflows: ["Generate Leaderboard Data"]
types:
- completed
# Manual trigger
workflow_dispatch:
permissions:
contents: write
jobs:
generate-stats:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Generate GitHub Stats SVG
run: npx tsx scripts/generateGitHubStats.ts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit and push if changed
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add public/github-stats.svg
git diff --staged --quiet || git commit -m "chore: update GitHub stats SVG"
git push