Node.js 将变量传递给bitbucket nodejs脚本

Node.js 将变量传递给bitbucket nodejs脚本,node.js,bitbucket-pipelines,Node.js,Bitbucket Pipelines,我正在使用bitbucket,并在管道设置中将令牌设置为安全变量 我想在我的脚本中使用该标记,因此我做到了: - step: name: 'Cancel Previous' script: - node ./pipelines/skip-previous.js $APP_PASSWORD 现在,我找不到一种方法来获取变量APP_密码 在节点js中,我是这样做的 const APP_PASSWORD = process.argv.slice(2); c

我正在使用bitbucket,并在管道设置中将令牌设置为安全变量

我想在我的脚本中使用该标记,因此我做到了:

  - step:
      name: 'Cancel Previous'
      script:
        - node ./pipelines/skip-previous.js $APP_PASSWORD
现在,我找不到一种方法来获取变量APP_密码

在节点js中,我是这样做的

const APP_PASSWORD = process.argv.slice(2);
console.log(process.argv);
但得到的是

[ “/usr/local/bin/node”, “/opt/atlassian/pipelines/agent/build/pipelines/skip previous.js”, “$APP_密码” ]


我试过使用
--
但什么都没有…

尝试在js代码中使用
process.env.APP\u密码


APP_PASSWORD变量是一个环境变量,因此应该可以通过
过程访问。env

您是否尝试过
${APP_PASSWORD}