Skip to content

Commit 46a0c67

Browse files
committed
update gh workflow
1 parent 243cf92 commit 46a0c67

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Update contribution stats
2+
3+
on:
4+
schedule:
5+
- cron: "17 6 * * *" # daily at 06:17 UTC
6+
workflow_dispatch: {}
7+
8+
permissions:
9+
contents: write # needed to commit/push changes :contentReference[oaicite:2]{index=2}
10+
11+
jobs:
12+
update:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Check out repo
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12"
23+
24+
- name: Generate contrib stats
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
run: |
28+
python tools/gen_contrib_stats.py
29+
30+
- name: Commit & push if changed
31+
run: |
32+
git config user.name "github-actions[bot]"
33+
git config user.email "github-actions[bot]@users.noreply.github.com"
34+
git add _data/contrib_stats.yml
35+
git diff --cached --quiet || git commit -m "Update contribution stats"
36+
git push

0 commit comments

Comments
 (0)