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
11
11
/build
12
12
.vscode
13
13
.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
38
38
const getPrefixedKey = ( key ) => `${ SECRET_PREFIX } ${ key } `
39
39
40
40
module . exports = {
41
- async onPreBuild ( { utils } ) {
41
+ async onPreBuild ( { netlifyConfig , utils } ) {
42
42
const {
43
43
NETLIFY_AWS_ACCESS_KEY_ID : accessKeyId ,
44
44
NETLIFY_AWS_SECRET_ACCESS_KEY : secretAccessKey ,
@@ -60,14 +60,11 @@ module.exports = {
60
60
const normalizedSecrets = await normalizeSecrets ( { client, secrets } )
61
61
62
62
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
67
68
} )
68
-
69
- const prefixedSecrets = Object . fromEntries ( entries . map ( ( [ key , value ] ) => [ getPrefixedKey ( key ) , value ] ) )
70
-
71
- Object . assign ( process . env , prefixedSecrets )
72
69
} ,
73
70
}
You can’t perform that action at this time.
0 commit comments