Read Only Access Token to a raw file from a Private repository. #36459
|
My apologies if "Code Security" is not the correct category I have chosen. I have a private repository. I generate an use this kind of link: I need to check the "Repo" when generating the access token. The problem is that I can not easily share that token to others. Is there any "Personal access tokens" option that will only give a read access to a raw file? P.S. |
Replies: 5 comments 1 reply
There isn't, and even if it did a read-only PAT would give access to all your private repositories, so it's probably not what you want. The correct solution is to give the people who need to read that file read access to the repository, so they can use their own tokens. As a side note, it's strongly recommended you send the token in an |
|
For completeness' sake, there's now a beta of PATs with more precise access settings: https://github.blog/2022-10-18-introducing-fine-grained-personal-access-tokens-for-github/ It's still not recommended to use that as a deployment option, as the article mentions, too. 😉 |
|
Hey there @ArshakKroyan and thank you for asking a good question! I'm glad you found our community 🙂 |
There isn't, and even if it did a read-only PAT would give access to all your private repositories, so it's probably not what you want.
The correct solution is to give the people who need to read that file read access to the repository, so they can use their own tokens.
As a side note, it's strongly recommended you send the token in an
Authorizationheader instead of including it in the URL, as described here: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#oauth2-token-sent-in-a-header