Skip to content

Commit 881bb91

Browse files
feat: solved authorization problem in syncing
1 parent 9fdfbc3 commit 881bb91

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

.github/workflows/sync.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@ on:
44
workflow_dispatch:
55

66
schedule:
7-
- cron: "0 */6 * * *" # Every 6 hours
7+
- cron: "0 */6 * * *"
88

99
permissions:
1010
contents: write
1111

1212
jobs:
1313
sync:
14-
1514
runs-on: ubuntu-latest
1615

1716
steps:
18-
1917
- name: Checkout repository
2018
uses: actions/checkout@v4
2119

@@ -29,20 +27,15 @@ jobs:
2927
python -m pip install --upgrade pip
3028
pip install -r requirements.txt
3129
30+
- name: Configure Git
31+
run: |
32+
git config --global user.name "${{ secrets.GIT_USERNAME }}"
33+
git config --global user.email "${{ secrets.GIT_EMAIL }}"
34+
3235
- name: Run LeetCode Sync
3336
env:
3437
LEETCODE_SESSION: ${{ secrets.LEETCODE_SESSION }}
3538
CSRF_TOKEN: ${{ secrets.CSRF_TOKEN }}
3639
LEETCODE_USERNAME: ${{ secrets.LEETCODE_USERNAME }}
37-
GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
38-
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
39-
4040
run: |
4141
python main.py
42-
43-
- name: Push changes
44-
run: |
45-
git config --global user.name "${{ secrets.GIT_USERNAME }}"
46-
git config --global user.email "${{ secrets.GIT_EMAIL }}"
47-
48-
git push

0 commit comments

Comments
 (0)