GithubHelp home page GithubHelp logo

Comments (4)

alexweininger avatar alexweininger commented on June 12, 2024 1

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.

Footnotes

  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

  3. https://docs.github.com/en/rest/actions/workflow-jobs?apiVersion=2022-11-28#about-workflow-jobs-in-github-actions

from vscode-azurestaticwebapps.

Kizito007 avatar Kizito007 commented on June 12, 2024

I'm having the same issue. Any progress with this?

from vscode-azurestaticwebapps.

Kizito007 avatar Kizito007 commented on June 12, 2024

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.

from vscode-azurestaticwebapps.

alexweininger avatar alexweininger commented on June 12, 2024

Upstream issue: microsoft/vscode#185915

from vscode-azurestaticwebapps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.