You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
LeetCode Sync
v1.0
GitHub Action for syncing LeetCode submissions to a GitHub repository.
To use this action:
-
Login to LeetCode and obtain the
csrftoken
andLEETCODE_SESSION
cookie values.- After logging in, right-click on the page and press
Inspect
. - Refresh the page.
- Look for a network request to https://leetcode.com.
- Look under
Request Headers
for thecookie:
attribute to find the values.
- After logging in, right-click on the page and press
-
Add the values as GitHub secrets, e.g.
LEETCODE_CSRF_TOKEN
andLEETCODE_SESSION
. -
Add a workflow file with this action under the
.github/workflows
directory, e.g.sync_leetcode.yml
:Example workflow file:
name: Sync Leetcode on: schedule: - cron: '0 8 * * *' jobs: build: runs-on: ubuntu-latest steps: - name: Sync uses: joshcai/leetcode-sync@v1.0 with: github-token: ${{ github.token }} leetcode-csrf-token: ${{ secrets.LEETCODE_CSRF_TOKEN }} leetcode-session: ${{ secrets.LEETCODE_SESSION }}