bash - 在 GitHub Actions 中使用上下文表达式内的变量

标签 bash github-actions

是否可以在 GitHub Actions 中的上下文表达式中使用另一个变量,例如

${{ steps.azure-secrets.outputs.$x }}

如果x=store-id那么上面的内容应该转换为

${{ steps.azure-secrets.outputs.store-id }}

这样我就可以使用这个表达式并让它计算值

最佳答案

这应该可以解决问题

${{ steps.azure-secrets.outputs[env.x] }}

请检查此主题 - Nested variable substitution

关于bash - 在 GitHub Actions 中使用上下文表达式内的变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69299781/

相关文章:

.net-core - Github 操作对 .net git Restore buld 使用存储库名称两次

github-actions - 如何从 GitHub Actions(非自托管用例)+ FaSTLane 将 dSYM 从 Xcode 14 发送到 Firebase

powershell - Github 操作 : set environment variable for Windows build with PowerShell

bash - bash 脚本应该如何确定 Maven 项目及其依赖项的类路径?

Bash重定向: named pipes and EOF

linux - 如何检查用户指定的名称是否引用目录?

azure - 如何在ARM模板中配置部署中心配置?

bash - 如何保存ssh登录欢迎横幅并断开连接

bash - 如何将 “escape hell”传递给docker run

ruby-on-rails - 工作流文件错误,未提供密码