Skip to content

Commit 7cb26cc

Browse files
Create leetcode-sync.yml
1 parent 06374d9 commit 7cb26cc

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Sync LeetCode Solutions
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # runs daily at midnight UTC
6+
workflow_dispatch: # allow manual run
7+
8+
jobs:
9+
sync:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repo
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.x'
19+
20+
- name: Install dependencies
21+
run: pip install git+https://github.com/kaiiyer/leetcode-sync.git
22+
23+
- name: Run sync
24+
env:
25+
LEETCODE_SESSION: ${{ secrets.LEETCODE_SESSION }}
26+
CSRFTOKEN: ${{ secrets.CSRFTOKEN }}
27+
run: leetcode-sync --username SAITEJA LUKKA --repo-path .
28+
29+
- name: Commit changes
30+
run: |
31+
git config --global user.name "GitHub Action"
32+
git config --global user.email "[email protected]"
33+
git add .
34+
git commit -m "Sync LeetCode solutions" || echo "No changes to commit"
35+
git push

0 commit comments

Comments
 (0)