File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -500,13 +500,14 @@ function GitProviders(props: {
500
500
setErrorMessage ( undefined ) ;
501
501
502
502
const token = await getGitpodService ( ) . server . getToken ( { host : ap . host } ) ;
503
- if ( token ) {
503
+ const isGitHubEnterprise = ap . authProviderType === "GitHub" && ap . host !== "github.com" ;
504
+ if ( token && ! ( isGitHubEnterprise && ! token . scopes . includes ( "public_repo" ) ) ) {
504
505
props . onHostSelected ( ap . host ) ;
505
506
return ;
506
507
}
507
508
await openAuthorizeWindow ( {
508
509
host : ap . host ,
509
- scopes : ap . requirements ?. default ,
510
+ scopes : isGitHubEnterprise ? [ "public_repo" ] : ap . requirements ?. default ,
510
511
onSuccess : async ( ) => {
511
512
props . onHostSelected ( ap . host , true ) ;
512
513
} ,
Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ export class ProjectsService {
148
148
const parsedUrl = RepoURL . parseRepoUrl ( project . cloneUrl ) ;
149
149
const hostContext = parsedUrl ?. host ? this . hostContextProvider . get ( parsedUrl ?. host ) : undefined ;
150
150
const type = hostContext && hostContext . authProvider . info . authProviderType ;
151
- if ( type === "GitLab" || type === "Bitbucket" ) {
151
+ if ( type === "GitLab" || type === "Bitbucket" || ( type === "GitHub" && parsedUrl ?. host !== "github.com" ) ) {
152
152
const repositoryService = hostContext ?. services ?. repositoryService ;
153
153
if ( repositoryService ) {
154
154
// Note: For GitLab, we expect .canInstallAutomatedPrebuilds() to always return true, because earlier
You can’t perform that action at this time.
0 commit comments