I see there’s a way to access GitHub repositories for both read and write from the MakeCode editor and this involves GitHub’s personal access token feature. The text in the editor suggests repo or public_repo, both being “full access” scopes.
It’s stored in local storage (implementation in pxt) in the browser, then used in the request url to GitHub. It’s queried from local storage here. The token is also used to identify which elements to show in a few react components (for example, whether to show the github extension option when importing a file).