Skip to content

Commit 63b4021

Browse files
opheliagoldsteinPhenix333qwerty541Copilot
authored
docs: add information about fine-grained personal access tokens (PATs) scopes (#4426)
* 🔧 Add .env example * 📝 Update README for add the PAT settings * 📝 Add fine-grained PAT documentation * remove .env.example * docs review * toc * more review * Update readme.md Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Colin-de-Seroux <[email protected]> Co-authored-by: Alexandr <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent f179fbe commit 63b4021

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

readme.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@
8484
- [Stats and top languages cards](#stats-and-top-languages-cards)
8585
- [Pinning repositories](#pinning-repositories)
8686
- [Deploy on your own](#deploy-on-your-own)
87+
- [First step: get your Personal Access Token (PAT)](#first-step-get-your-personal-access-token-pat)
88+
- [Classic token](#classic-token)
89+
- [Fine-grained token](#fine-grained-token)
8790
- [On Vercel](#on-vercel)
8891
- [:film\_projector: Check Out Step By Step Video Tutorial By @codeSTACKr](#film_projector-check-out-step-by-step-video-tutorial-by-codestackr)
8992
- [On other platforms](#on-other-platforms)
@@ -764,6 +767,38 @@ By default, GitHub does not lay out the cards side by side. To do that, you can
764767

765768
# Deploy on your own
766769

770+
## First step: get your Personal Access Token (PAT)
771+
772+
Selecting the right scopes for your token is important in case you want to display private contributions on your stats card.
773+
774+
### Classic token
775+
776+
Steps:
777+
- Go to [Account -> Settings -> Developer Settings -> Personal access tokens -> Tokens (classic)](https://github.com/settings/tokens).
778+
- Click on `Generate new token -> Generate new token (classic)`.
779+
- Scopes to select:
780+
- repo
781+
- read:user
782+
- Click on `Generate token` and copy it.
783+
784+
### Fine-grained token
785+
786+
> [!WARNING]\
787+
> This limits the number of issues to the number of issues on your repositories only and only takes public commits into account.
788+
789+
Steps:
790+
- Go to [Account -> Settings -> Developer Settings -> Personal access tokens -> Fine-grained tokens](https://github.com/settings/tokens).
791+
- Click on `Generate new token -> Generate new token`.
792+
- Select an expiration date
793+
- Select `All repositories`
794+
- Scopes to select in `Repository permission`:
795+
- Commit statuses: read-only
796+
- Contents: read-only
797+
- Issues: read-only
798+
- Metadata: read-only
799+
- Pull requests: read-only
800+
- Click on `Generate token` and copy it.
801+
767802
## On Vercel
768803

769804
### :film\_projector: [Check Out Step By Step Video Tutorial By @codeSTACKr](https://youtu.be/n6d4KHSKqGk?t=107)
@@ -793,7 +828,7 @@ Since the GitHub API only allows 5k requests per hour, my `https://github-readme
793828
![](https://files.catbox.moe/3n76fh.png)
794829
8. Click the `Continue with GitHub` button, search for the required Git Repository and import it by clicking the `Import` button. Alternatively, you can import a Third-Party Git Repository using the `Import Third-Party Git Repository ->` link at the bottom of the page.
795830
![](https://files.catbox.moe/mg5p04.png)
796-
9. Create a personal access token (PAT) [here](https://github.com/settings/tokens/new) and enable the `repo` and `user` permissions (this allows access to see private repo and user stats).
831+
9. Create a Personal Access Token (PAT) as described in the [previous section](#first-step-get-your-personal-access-token-pat).
797832
10. Add the PAT as an environment variable named `PAT_1` (as shown).
798833
![](https://files.catbox.moe/0yclio.png)
799834
11. Click deploy, and you're good to go. See your domains to use the API!

0 commit comments

Comments
 (0)