@@ -369,7 +369,7 @@ export default class SetupPushSecrets extends Command {
369369 }
370370 }
371371
372- private async updateProductionYaml ( provider : string ) : Promise < void > {
372+ private async updateProductionYaml ( provider : string , prefixName ?: string ) : Promise < void > {
373373 const valuesDir = path . join ( process . cwd ( ) , this . flags [ 'values-dir' ] ) ;
374374 if ( ! fs . existsSync ( valuesDir ) ) {
375375 this . error ( chalk . red ( `Values directory not found at ${ valuesDir } ` ) ) ;
@@ -432,17 +432,19 @@ export default class SetupPushSecrets extends Command {
432432 }
433433
434434 // Update remoteRef for l2-sequencer secrets
435- if ( secretName . match ( / ^ l 2 - s e q u e n c e r - \d + - s e c r e t $ / ) ) {
435+ if ( secretName . match ( / ^ l 2 - s e q u e n c e r - s e c r e t - \d + - e n v $ / ) ) {
436436 for ( const data of secret . data ) {
437437 if ( data . remoteRef && data . remoteRef . key ) {
438- data . remoteRef . key = 'l2-sequencer-secret' ;
438+ // Use the prefixName if available
439+ const prefix = prefixName || ( data . remoteRef . key . startsWith ( 'scroll/' ) ? 'scroll' : '' ) ;
440+ data . remoteRef . key = `${ prefix } /l2-sequencer-secret-env` ;
439441 updated = true ;
440442 }
441443 }
442444 }
443445 }
444446 }
445-
447+
446448 if ( updated ) {
447449 const newContent = yaml . dump ( yamlContent , { lineWidth : - 1 , noRefs : true , quotingType : '"' , forceQuotes : true } ) ;
448450 fs . writeFileSync ( yamlPath , newContent ) ;
@@ -470,11 +472,13 @@ export default class SetupPushSecrets extends Command {
470472
471473 let service : SecretService
472474 let provider : string
475+ let prefixName : string | undefined
473476
474477 if ( secretService === 'aws' ) {
475478 const awsCredentials = await this . getAWSCredentials ( )
476479 service = new AWSSecretService ( awsCredentials . secretRegion , awsCredentials . prefixName , flags . debug )
477480 provider = 'aws'
481+ prefixName = awsCredentials . prefixName
478482 } else if ( secretService === 'vault' ) {
479483 service = new HashicorpVaultDevService ( flags . debug )
480484 provider = 'vault'
@@ -491,7 +495,7 @@ export default class SetupPushSecrets extends Command {
491495 } )
492496
493497 if ( shouldUpdateYaml ) {
494- await this . updateProductionYaml ( provider )
498+ await this . updateProductionYaml ( provider , prefixName )
495499 this . log ( chalk . green ( 'Production YAML files updated successfully' ) )
496500 } else {
497501 this . log ( chalk . yellow ( 'Skipped updating production YAML files' ) )
0 commit comments