File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -11,3 +11,6 @@ node_modules
1111/build
1212.vscode
1313.env
14+
15+ # Local Netlify folder
16+ .netlify
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ const SECRET_PREFIX = process.env.NETLIFY_AWS_SECRET_PREFIX || 'NETLIFY_AWS_SECR
3838const getPrefixedKey = ( key ) => `${ SECRET_PREFIX } ${ key } `
3939
4040module . exports = {
41- async onPreBuild ( { utils } ) {
41+ async onPreBuild ( { netlifyConfig , utils } ) {
4242 const {
4343 NETLIFY_AWS_ACCESS_KEY_ID : accessKeyId ,
4444 NETLIFY_AWS_SECRET_ACCESS_KEY : secretAccessKey ,
@@ -60,14 +60,11 @@ module.exports = {
6060 const normalizedSecrets = await normalizeSecrets ( { client, secrets } )
6161
6262 const entries = Object . entries ( normalizedSecrets )
63- entries . forEach ( ( [ key ] ) => {
64- console . log (
65- `${ chalk . bold ( 'Injecting AWS secret' ) } ${ chalk . magenta ( `${ key } ` ) } as ${ chalk . green ( getPrefixedKey ( key ) ) } ` ,
66- )
63+ entries . forEach ( ( [ key , value ] ) => {
64+ const prefixedKey = getPrefixedKey ( key )
65+ console . log ( `${ chalk . bold ( 'Injecting AWS secret' ) } ${ chalk . magenta ( `${ key } ` ) } as ${ chalk . green ( prefixedKey ) } ` )
66+ // eslint-disable-next-line no-param-reassign
67+ netlifyConfig . build . environment [ prefixedKey ] = value
6768 } )
68-
69- const prefixedSecrets = Object . fromEntries ( entries . map ( ( [ key , value ] ) => [ getPrefixedKey ( key ) , value ] ) )
70-
71- Object . assign ( process . env , prefixedSecrets )
7269 } ,
7370}
You can’t perform that action at this time.
0 commit comments