LeetCode Cookies Updater is a GitHub Action that automatically updates LeetCode CSRF token and session cookie values in your GitHub repository secrets every 2 weeks. This is useful for keeping your LeetCode syncing workflows running without manual intervention.
Add the following workflow to your repository in the .github/workflows
directory:
name: Update Leetcode Cookies
on:
schedule:
- cron: "0 0 */14 * *" # Run every 2 weeks
jobs:
update_cookies:
runs-on: ubuntu-latest
steps:
- name: Update Leetcode cookies
uses: vishrutkmr7/UpdateLCCookies@v1.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
leetcode-email: ${{ secrets.LEETCODE_EMAIL }}
leetcode-password: ${{ secrets.LEETCODE_PASSWORD }}
You need to set the following secrets in your GitHub repository:
GITHUB_TOKEN
: A GitHub token with therepo
scope. Learn how to create a Personal Access Token.LEETCODE_EMAIL
: Your LeetCode account email.LEETCODE_PASSWORD
: Your LeetCode account password.
To add the secrets:
- Go to the main page of your repository on GitHub.
- Click on the "Settings" tab.
- In the left sidebar, click on "Secrets".
- Click on the "New repository secret" button and add the
GITHUB_TOKEN
,LEETCODE_EMAIL
, andLEETCODE_PASSWORD
secrets one by one with the corresponding values.
We welcome contributions to the LeetCode Cookies Updater! If you'd like to contribute, please fork the repository, make your changes, and submit a pull request.
This project is licensed under the MIT License. The full text of the license can be found at https://choosealicense.com/licenses/mit/.