简体   繁体   English

Github Actions 从管道创建秘密

[英]Github Actions create secret from pipeline

I am creating Cloud Resources from Github actions using Terraform.我正在使用 Terraform 从 Github 操作创建云资源。 To authenticate against the cloud provider I am using client secret stored as Github secret.为了对云提供商进行身份验证,我使用存储为 Github 机密的客户端机密。 Nevertheless I obtain connection strings from resources I created in the cloud as output from terraform and I need to store those as secret for use in further steps of the pipeline.尽管如此,我从我在云中创建的资源中获取连接字符串作为 terraform 的输出,我需要将它们存储为机密,以便在管道的进一步步骤中使用。 Please any suggestion how to achieve that?请任何建议如何实现这一目标?

I found out, it is not necessary to create a secret, in my case.我发现,就我而言,没有必要创建秘密。 I ended up using add mask command which masks specified string across whole pipeline:我最终使用了 add mask 命令,该命令在整个管道中屏蔽了指定的字符串:

- name: Set env
  run: |
   x="randomstring"
   echo ::add-mask::$x
   echo $x

Output: ***

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM