如何屏蔽 GitHub Workflow 中设置的环境
我使用以下命令来设置环境变量:
- name: get root token
run: |
echo "ROOT_TOKEN=$(some command | base64 --decode)" >> $GITHUB_ENV
然后我在 Python 脚本中的另一次运行中使用它:
- name: init
run: |
python3 scripts/create_entries.py
实际上这效果很好,但是 ROOT_TOKEN
的值打印在工作流控制台中:
Run python3 scripts/create_entries.py
python3 scripts/create_entries.py
shell: /usr/bin/bash -e ***0***
env:
DATA: ***
CONFIG: /home/debian/runner/_work/_temp/config_1646400032032
ROOT_TOKEN: <this is shown>
我尝试像这样使用 ::add-mask::
屏蔽它(但不幸的是这不起作用):
- name: get root token
run: |
echo "::add-mask::ROOT_TOKEN=$(some command | base64 --decode)" >> $GITHUB_ENV
有谁知道如何在工作流控制台中屏蔽 ROOT_TOKEN
的值?
I am using the following to set a env variable:
- name: get root token
run: |
echo "ROOT_TOKEN=$(some command | base64 --decode)" >> $GITHUB_ENV
Then I use it in another run within a Python script:
- name: init
run: |
python3 scripts/create_entries.py
Actually this works great, but the value of ROOT_TOKEN
is printed in the Workflow console:
Run python3 scripts/create_entries.py
python3 scripts/create_entries.py
shell: /usr/bin/bash -e ***0***
env:
DATA: ***
CONFIG: /home/debian/runner/_work/_temp/config_1646400032032
ROOT_TOKEN: <this is shown>
I tried to mask it using ::add-mask::
like this (but unfortunately that does not work):
- name: get root token
run: |
echo "::add-mask::ROOT_TOKEN=$(some command | base64 --decode)" >> $GITHUB_ENV
Does anyone know how to mask the value of ROOT_TOKEN
in the Workflow console?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该适合您:
在此处查看更多信息:https://stackoverflow.com/a/73041579/17546520
This should work for you:
See more here: https://stackoverflow.com/a/73041579/17546520