File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 11import * as vscode from "vscode" ;
22import { getSession } from "../auth/auth" ;
3+ import { canReachGitHubAPI } from "../api/canReachGitHubAPI" ;
4+ import { getGitHubContext } from "../git/repository" ;
35
46export function registerSignIn ( context : vscode . ExtensionContext ) {
57 context . subscriptions . push (
68 vscode . commands . registerCommand ( "github-actions.sign-in" , async ( ) => {
79 const session = await getSession ( true ) ;
810 if ( session ) {
11+ const canReachAPI = await canReachGitHubAPI ( ) ;
12+ const ghContext = await getGitHubContext ( ) ;
13+ const hasGitHubRepos = ghContext && ghContext . repos . length > 0 ;
14+
915 await vscode . commands . executeCommand ( "setContext" , "github-actions.signed-in" , true ) ;
16+ await vscode . commands . executeCommand ( "setContext" , "github-actions.internet-access" , canReachAPI ) ;
17+ await vscode . commands . executeCommand ( "setContext" , "github-actions.has-repos" , hasGitHubRepos ) ;
1018 }
1119 } )
1220 ) ;
You can’t perform that action at this time.
0 commit comments