【问题标题】:Echo not outputting variable value回显不输出变量值
【发布时间】:2022-07-17 15:18:50
【问题描述】:

我正在尝试打印 API_RESPONSE 的值,但它会打印 "response is: "。 S3_RESPONSE 值已设置,但 API_RESPONSE 在 echo 命令中显示为空白。

  - name: Check if certificate exists
    id: check_certificate
    run: |
      API_RESPONSE=$(aws s3api head-object --bucket test-bucket-ssl --key fullchain.pem 2>&1 | tee true)
      echo "::set-output name=S3_RESPONSE::$(echo $API_RESPONSE)"
      echo "response is: ${API_RESPONSE}"

【问题讨论】:

    标签: github-actions


    【解决方案1】:

    我认为,而不是

    response is: ${API_RESPONSE}
    

    你应该使用

    response is: ${{API_RESPONSE}}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-08
      • 2013-10-12
      • 1970-01-01
      相关资源
      最近更新 更多