从github操作的变量中获取数组元素
在GitHub Action File中,我正在运行AWS CLI命令,并存储使用Set-ouput的输出,并在下一步中重复使用它。
name: abc-name
id: abc
bash : |
set-ouput name=opValue::$(aws ......command.....)
name: check
bash : echo ${{steps.abc.output.opValue}}
但是AWS命令的输出以数组的形式(例如“ value”),并且被存储在变量opvalue中。
在下一个“检查步骤”中,我只想获取它的值,而不是数组。
In github action file, I am running an AWS CLI command and storing the output of using set-ouput and reusing it in next step.
name: abc-name
id: abc
bash : |
set-ouput name=opValue::$(aws ......command.....)
name: check
bash : echo ${{steps.abc.output.opValue}}
but the aws command's output is in the form of array like ["value"] and same is getting stored in variable opValue.
In my next "check step", I want to only fetch value of it, not the array.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 jq 选择
aws aws
命令>命令输出和存储的第一个值仅作为输出:Use jq to select the first value of the
aws
command output and store only that as output: