ADO秘密变量: MY_SECRET_VAR=blablabla
ADO powershell脚本作为构建任务:
# secrets aren't automatically env variables - so try to explicitly set it
echo "##vso[task.setvariable variable=MY_SECRET_VAR]$(MY_SECRET_VAR)"
# run a node.js script that needs to use the secret
npm run <my-node-script>
Node.js脚本:
process.env.MY_SECRET_VAR //undefined
如何从node.js中将机密作为环境变量访问?