Closed v-xinda closed 1 year ago
I'm having the same issue. Any progress with this?
I'm having the same issue. Any progress with this?
So apparently this error happened on my browser. So when I moved the codespace to Vs Code desktop it worked fine.
As stated in the issue description this only reproduces when connected to a GitHub CodeSpace in a browser. I'm able to consistently reproduce this error.
In my investigation, I found that the type of token returned to the extension by the built-in VS Code GitHub authentication provider is different on browser CodeSpaces than it is everywhere else.
In a browser connected to a CodeSpace we receive "GitHub App user-to-server tokens" (prefixed with ghu_
). In all other places I tested, we receive "OAuth access tokens" (prefixed by gho_
) [^1]. The user-to-server tokens are created by GitHub Apps, whereas OAuth tokens are created by OAuth apps [^2].
ghu
tokens have their own set of scopes different from gho
tokens. I discovered that ghu
tokens require the actions
scope for workflow related REST API endpoints ^3. Adding the actions
scope to our requested scopes does fix the issue, but what happens is this makes the GitHub authentication provider return a gho
token. So an easy fix is to just request an additional scope outside of the default ghu
token so that we get a gho
token.
[^1]: GitHub authentication token formats: https://github.blog/2021-04-05-behind-githubs-new-authentication-token-formats/ [^2]: Differences between GitHub Apps and OAuth apps https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/differences-between-github-apps-and-oauth-apps
Upstream issue: https://github.com/microsoft/vscode/issues/185915
OS: Remote Codespaces Build Version: 20230423.1 Regression: Previous release (0.11.4)
Repro Steps:
Expect: No error occurs.
Actual: An error occurs.![image](https://user-images.githubusercontent.com/57662131/233925568-69b19ed5-1463-4671-b193-64728487bd35.png)
More Info: