@@ -103,15 +103,15 @@ export async function linkGitHubRepository(
103
103
existingConns . push ( refreshedConn ) ;
104
104
}
105
105
106
- let { remoteUri, connection } = await promptRepositoryUri ( projectId , location , existingConns ) ;
106
+ let { remoteUri, connection } = await promptRepositoryUri ( projectId , existingConns ) ;
107
107
while ( remoteUri === "" ) {
108
108
await utils . openInBrowser ( "https://github.com/apps/google-cloud-build/installations/new" ) ;
109
109
await promptOnce ( {
110
110
type : "input" ,
111
111
message :
112
112
"Press ENTER once you have finished configuring your installation's access settings." ,
113
113
} ) ;
114
- const selection = await promptRepositoryUri ( projectId , location , existingConns ) ;
114
+ const selection = await promptRepositoryUri ( projectId , existingConns ) ;
115
115
remoteUri = selection . remoteUri ;
116
116
connection = selection . connection ;
117
117
}
@@ -130,12 +130,11 @@ export async function linkGitHubRepository(
130
130
131
131
async function promptRepositoryUri (
132
132
projectId : string ,
133
- location : string ,
134
133
connections : gcb . Connection [ ]
135
134
) : Promise < { remoteUri : string ; connection : gcb . Connection } > {
136
135
const remoteUriToConnection : Record < string , gcb . Connection > = { } ;
137
136
for ( const conn of connections ) {
138
- const { id } = parseConnectionName ( conn . name ) ! ;
137
+ const { location , id } = parseConnectionName ( conn . name ) ! ;
139
138
const resp = await gcb . fetchLinkableRepositories ( projectId , location , id ) ;
140
139
if ( resp . repositories && resp . repositories . length > 0 ) {
141
140
for ( const repo of resp . repositories ) {
0 commit comments