-
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (35 loc) · 1.11 KB
/
Copy pathupdate_problems.yml
File metadata and controls
43 lines (35 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
# .github/workflows/update_problems.yml
# Place in: java_progress/.github/workflows/
name: Update LeetCode Problem List
on:
push:
branches: [main]
paths:
- "JAVA/LeetCode/**" # triggers only when a new solution is pushed
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for git log dates
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install requests
- name: Generate PROBLEMS.md
run: python .github/scripts/update_problems.py
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add PROBLEMS.md README.md
git diff --staged --quiet || git commit -m "📋 Auto-update problem list"
git push