-
-
Notifications
You must be signed in to change notification settings - Fork 47
44 lines (36 loc) · 1.07 KB
/
python-publish.yml
File metadata and controls
44 lines (36 loc) · 1.07 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
name: Update Stats
on:
workflow_dispatch:
schedule:
# Runs every 12 hours
- cron: "0 */12 * * *"
permissions:
contents: write
jobs:
update-leetcode:
name: Update local LeetCode stats card
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm install node-fetch@2
- name: Generate latest LeetCode SVG
run: |
mkdir -p assets
node .github/scripts/update_leetcode.cjs
- name: Commit and push updated LeetCode card
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add assets/leetcode.svg
git commit -m "chore: update LeetCode stats" || echo "No changes to commit"
git push