File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 8383 access_token_lifetime : ${{ fromJson(env.CI_SETUP).access-token-lifetime }}
8484 - name : Export environment variables
8585 uses : actions/github-script@v7
86+ id : vars
8687 with :
8788 script : |
8889 const setup = JSON.parse(process.env.CI_SETUP)
@@ -94,11 +95,17 @@ jobs:
9495 console.log(`${key}: ${env[key]}`)
9596 core.exportVariable(key, env[key])
9697 }
98+ return {
99+ "env": env,
100+ "secrets": Object.keys(setup.secrets || {})
101+ .map(key => `${key}:${setup.secrets[key]}`)
102+ .join('\n'),
103+ }
97104 - name : Get Secret Manager secrets
98105 uses : google-github-actions/get-secretmanager-secrets@v2
99- if : fromJson(env.CI_SETUP) .secrets != null
106+ if : steps.vars.outputs.result .secrets != null
100107 with :
101- secrets : ${{ join(fromJson(env.CI_SETUP). secrets) }}
108+ secrets : ${{ steps.vars.outputs.result. secrets }}
102109 export_to_environment : true
103110 - name : 🛠️ Test ${{ matrix.path }}
104111 run : |
Original file line number Diff line number Diff line change 33 "env" : {
44 "MY_ENV_VAR" : 42
55 },
6- "secrets" : [
7- " CAIP_PROJECT_ID: nodejs-docs-samples-tests/nodejs-docs-samples-ai-platform-caip-project-id" ,
8- " LOCATION: nodejs-docs-samples-tests/nodejs-docs-samples-ai-platform-location" ,
9- " DATASTORE_ID: nodejs-docs-samples-tests/nodejs-docs-samples-ai-platform-datastore-id"
10- ]
6+ "secrets" : {
7+ "CAIP_PROJECT_ID" : " nodejs-docs-samples-tests/nodejs-docs-samples-ai-platform-caip-project-id" ,
8+ "LOCATION" : " nodejs-docs-samples-tests/nodejs-docs-samples-ai-platform-location" ,
9+ "DATASTORE_ID" : " nodejs-docs-samples-tests/nodejs-docs-samples-ai-platform-datastore-id"
10+ }
1111}
You can’t perform that action at this time.
0 commit comments