YALCST is a GITHUB ACTION to sync LeetCode submissions into GITHUB REPO automatically, written in Python.
REPO ON HOW IT WILL LOOK LIKE AFTER USING THIS GH ACTION
- Sync accepted solutions with submission time as commit time
- Add description of submitted problem from Leetcode
- Add notes if there is any saved in LeetCode
- Sync only solutions that are not previously synced
-
Get auth. tokens from LeetCode
- Open Network tab in DevTools for LeetCode page, now refresh page
- Inspect any one of the request's header section
- Check for
csrftoken
andLEETCODE_SESSION
incookie
section and save
-
Adding Github SECRETS
- Make a new Github repository
- Add
LEETCODE_CSRF_TOKEN
andLEETCODE_SESSION
as keys and tokens obtained as values in Github repo secrets accordingly.
-
Adding workflow file
- Create new
sync_leetcode.yml
file inside.github/workflows
folder with content of file as
name: YALCST on: workflow_dispatch: schedule: - cron: '0 8 * * 6' jobs: Sync: runs-on: ubuntu-latest steps: - name: Sync uses: m4tu4g/YALCST@main with: github-token: ${{ github.token }} leetcode-csrf-token: ${{ secrets.LEETCODE_CSRF_TOKEN }} leetcode-session: ${{ secrets.LEETCODE_SESSION }}
- Edit cron parameter, which is defaulted to run once a week, if needed
- Create new
-
Start workflow
- Goto the action
YALCST
inActions
tab - Now click
Run workflow
for manual run.
- Goto the action
- Josh Cai's implementation in JavaScript