This repository contains a custom script to sync accepted LeetCode submissions to a GitHub repository. Solutions are written to a separate target repository via the GitHub API. The script is intended to be run locally with access scoped to a single GitHub repository.
The script:
- fetches accepted submissions from LeetCode using authenticated GraphQL requests
- uploads new solutions to a GitHub repository
The sync is idempotent and safe to run repeatedly.
To reuse the script, create a local .env file (not committed) with the following variables:
LC_USERNAME,
LC_LEETCODE_SESSION,
LC_CSRF_TOKEN,
GH_TOKEN,
GH_OWNER,
GH_REPO,
GH_BRANCH