Skip to content

Sync Leetcode

Sync Leetcode #195

Workflow file for this run

name: Sync Leetcode
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Sync
uses: joshcai/leetcode-sync@v1.7
with:
github-token: ${{ github.token }}
leetcode-csrf-token: ${{ secrets.LEETCODE_CSRF_TOKEN }}
leetcode-session: ${{ secrets.LEETCODE_SESSION }}
destination-folder: submissions/
verbose: true
commit-header: "submit:"
update-readme:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Dependencies
run: pip install --upgrade pip
- name: Generate README
run: python .github/script.py
- name: Commit and Push Changes
run: |
git pull
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md
git commit -m "Update README.md in submissions"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}