Github 操作 echo 命令未创建文件

bry*_*yan 6 github-actions

我正在将一个可用的 CircleCI 工作流转移到 Github Actions。

我在跑:

runs-on: ubuntu-latest

container: 
  image: google/cloud-sdk:latest
Run Code Online (Sandbox Code Playgroud)

我运行以下命令:

echo ${{ secrets.GCLOUD_API_KEYFILE }} > ./gcloud-api-key.json
Run Code Online (Sandbox Code Playgroud)

在运行此命令之前,尚未创建gcloud-api-key.json。此命令在 CircleCI 中有效,但在 Github Actions 中出现错误:

/__w/_temp/asd987as89d7cf.sh: 2: /__w/_temp/asd987as89d7cf.sh: type:: not found

有谁知道这个错误是什么意思?

bry*_*yan 7

原因是因为我的密钥超过 1 行。一旦我做了一行,它就起作用了。

  • 你如何回显超过 1 行长的内容? (2认同)