File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/init/features/frameworks Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,17 @@ async function promptRepositoryUri(
163
163
async function promptSecretManagerAdminGrant ( projectId : string ) : Promise < Boolean > {
164
164
const projectNumber = await getProjectNumber ( { projectId } ) ;
165
165
const cbsaEmail = gcb . serviceAgentEmail ( projectNumber ) ;
166
+
167
+ const alreadyGranted = await rm . serviceAccountHasRoles (
168
+ projectId ,
169
+ cbsaEmail ,
170
+ [ "roles/secretmanager.admin" ] ,
171
+ true
172
+ ) ;
173
+ if ( alreadyGranted ) {
174
+ return true ;
175
+ }
176
+
166
177
utils . logBullet (
167
178
"To create a new GitHub connection, Secret Manager Admin role (roles/secretmanager.admin) is required on the Cloud Build Service Agent."
168
179
) ;
@@ -205,7 +216,7 @@ async function promptConnectionAuth(conn: gcb.Connection): Promise<gcb.Connectio
205
216
async function promptAppInstall ( conn : gcb . Connection ) : Promise < gcb . Connection > {
206
217
utils . logBullet ( "Now, install the Cloud Build GitHub app:" ) ;
207
218
const targetUri = conn . installationState . actionUri . replace ( "install_v2" , "direct_install_v2" ) ;
208
- utils . logBullet ( targetUri ) ;
219
+ utils . logBullet ( `\t ${ targetUri } ` ) ;
209
220
await utils . openInBrowser ( targetUri ) ;
210
221
await promptOnce ( {
211
222
type : "input" ,
You can’t perform that action at this time.
0 commit comments