Skip to content

updated README with better steps #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,21 @@ GitHub Action for automatically syncing LeetCode submissions to a GitHub reposit
- Look for a network request to https://leetcode.com.
- Look under `Request Headers` for the `cookie:` attribute to find the values.

2. Create a new GitHub repository to host the LeetCode submissions.
(or)
- After logging in, right-click on the page and press `Inspect`.
- Go to `Application Tab > Storage > Cookies`
- Look for `http://leetcode.com` and get `cfsrtoken` and `SESSION_TOKEN`

3. Create a new GitHub repository to host the LeetCode submissions.

- It can be either private or public.

3. Add the values from step 1 as [GitHub secrets](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-a-repository),
4. Add the values from step 1 as [GitHub secrets](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-a-repository),
e.g. `LEETCODE_CSRF_TOKEN` and `LEETCODE_SESSION`.

4. Go to REPO > settings > actions and in Workflow Permissions section give actions Read and Write permissions.
5. Go to `REPO Settings > Actions`. In Workflow Permissions section, give actions Read and Write permissions.

5. Add a workflow file with this action under the `.github/workflows` directory, e.g. `sync_leetcode.yml`.
6. Add a workflow file with this action under the `.github/workflows` directory, e.g. `sync_leetcode.yml`.

Example workflow file:

Expand Down Expand Up @@ -58,6 +63,7 @@ GitHub Action for automatically syncing LeetCode submissions to a GitHub reposit
commit-header: "[LeetCode Sync]"
```

7. Go to your repository's `Settings` tab, and in the left sidebar, click Actions, then click General. Under `Workflow permissions`, change to `Read and Write permissions`
6. After you've submitted a LeetCode solution, run the workflow by going to the `Actions` tab, clicking the action name, e.g. `Sync Leetcode`, and then clicking `Run workflow`. The workflow will also automatically run once a week by default (can be configured via the `cron` parameter).

## Inputs
Expand Down