LeetCode Synchronizer
ActionsAbout
Tags
(2)LeetCode Synchronizer is a GitHub Action that automatically collects and organizes LeetCode submissions into a GitHub repository.
Here's a sample repository created using LeetCode Synchronizer: leetcode-synchronizer-sample
- Fully automated collection of all your latest accepted submissions with minimal effort setup
- Single commit for each submission stamped with the original submission date for building rich and accurate contributions graph
- Automated git pushes to the remote repository with every action triggers
- Auto-generate README.md based on retrieved submissions
-
Retrieve LeetCode cookies
- Login to LeetCode
- Open
Web Developer Tools - Find
https://leetcode.comfromStorage > Cookies - Copy values for cookies
LEETCODE_SESSIONandcsrftoken
-
Create a GitHub repository for LeetCode synchronization
-
Create GitHub Secrets for LeetCode API access
- Open
Settings > Secrets and variables > Actionsfrom the repository - Click
New repository secret - Create a new secret
LEETCODE_SESSIONusingLEETCODE_SESSIONcookie value - Create a new secret
LEETCODE_CSRF_TOKENusingcsrftokencookie value
- Open
-
Give workflows write permissions in the repository for git pushes
- Open
Settings > Actions > Generalfrom the repository - Select
Read and write permissionsfromWorkflow permissionsand save
- Open
-
Create GithHub Action
-
Create a workflow directory
.github/workflows/ -
Create a workflow file, e.g.,
leetcode_synchronizer.yml -
Copy the following YAML contents into the
leetcode_synchronizer.ymlfile:name: LeetCode Synchronizer on: workflow_dispatch jobs: build: runs-on: ubuntu-latest steps: - name: Run LeetCode Synchronizer uses: dos-m0nk3y/LeetCode-Synchronizer@v1.1.0 with: GITHUB_TOKEN: ${{ github.token }} LEETCODE_SESSION: ${{ secrets.LEETCODE_SESSION }} LEETCODE_CSRF_TOKEN: ${{ secrets.LEETCODE_CSRF_TOKEN }}
-
-
Trigger GitHub action
- Open
Actions > LeetCode Synchronizerfrom the repository - Click
Run workflow > Run workflow
- Open
GITHUB_TOKEN- required. GitHub token used in pushing submissions to the repositoryLEETCODE_SESSION- required. LeetCode session used in accessing LeetCode APILEETCODE_CSRF_TOKEN- required. LeetCode CSRF token used in accessing LeetCode API
LeetCode Synchronizer is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.