File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed
Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 2323 "workload-identity-provider" : " projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider" ,
2424 "service-account" :
" [email protected] " ,
2525 "access-token-lifetime" : " 600s" , // 10 minutes
26+ "env" : null ,
2627 "secrets" : null
2728 },
2829 "ignore" : [
Original file line number Diff line number Diff line change 6464 path : ${{ fromJson(github.event_name == 'pull_request' && needs.affected.outputs.nodejs-paths || '[]') }}
6565 env :
6666 CI_SETUP : ${{ toJson(fromJson(needs.affected.outputs.nodejs-setups)[matrix.path])}}
67- GOOGLE_SAMPLES_PROJECT : ${{ fromJson(needs.affected.outputs.nodejs-setups)[matrix.path].project-id }}
6867 steps :
6968 - name : CI Setup
7069 run : echo "${{ env.CI_SETUP }}"
@@ -86,12 +85,15 @@ jobs:
8685 uses : actions/github-script@v7
8786 with :
8887 script : |
89- console.log("Hello")
90- // CI_SETUP: ${{ fromJson(env.CI_SETUP) }}
91- // GOOGLE_SAMPLES_PROJECT: ${{ fromJson(env.CI_SETUP).project }}
92- console.log(typeof env)
93- console.log(JSON.stringify(env))
94- console.log(${{ fromJson(env.CI_SETUP).project }})
88+ const setup = JSON.parse(process.env.CI_SETUP)
89+ const env = {
90+ 'GOOGLE_SAMPLES_PROJECT': setup['project-id'],
91+ ...(setup.env || {})
92+ }
93+ for (const key in env) {
94+ console.log(`${key}: ${env[key]}`)
95+ core.exportVariable(key, env[key])
96+ }
9597 - name : Get Secret Manager secrets
9698 uses : google-github-actions/get-secretmanager-secrets@v2
9799 if : fromJson(env.CI_SETUP).secrets != null
Original file line number Diff line number Diff line change 11{
22 "node-version" : 18 ,
3+ "env" : {
4+ "MY_ENV_VAR" : 42
5+ },
36 "secrets" : [
47 " CAIP_PROJECT_ID:nodejs-docs-samples-tests/nodejs-docs-samples-ai-platform-caip-project-id" ,
58 " LOCATION:nodejs-docs-samples-tests/nodejs-docs-samples-ai-platform-location" ,
You can’t perform that action at this time.
0 commit comments