Use personal access token to view raw content of files in GitHub

Viewed 37

How can I use personal access token to view raw content of files in GitHub? I tried to do it with token@raw..., username:token@raw... etc. but none of them worked.

IMPORTANT NOTE: I need to use the token in URL.

1 Answers

This format (replacing the capitalized sections) should work:

https://TOKEN@raw.githubusercontent.com/USER/REPO/BRANCH/PATH

Note that this appears to block web browsers, you'd have to make a GET request from an HTTP client (like Insomnia) to test it. If this doesn't work in your plugin, please explain what happens, as it may be sending the wrong headers.

Related