小编sha*_*kka的帖子

Github Actions 和 git clone 问题

在 Github Actions 中使用 git clone 时遇到一些问题,无论我尝试什么,我都会得到以下信息:

我的 main.yml 中失败的代码:

jobs:
 terraform:
   name: 'Terraform with Github Actions!'
   runs-on: ubuntu-latest
   steps:
   - name: 'Login to Azure'
    uses: azure/login@v1
    with:
      creds: ${{ secrets.AZURE_CREDENTIALS }}
  - name: 'Checkout'
    uses: actions/checkout@master
  - name: 'Preparing blueprint-environment'
    run: |
      snip
      git clone git@github.com:ourcompany/whateverrepo.git
Run Code Online (Sandbox Code Playgroud)

错误信息:

git@github.com:权限被拒绝(公钥)。

我看过很多关于添加 ssh 密钥的帖子,但那是本地的,而不是在从 Github 操作运行的 ubuntu 版本中 - 我在这里缺少什么?我无法生成 ssh 密钥并将私钥动态添加到 Github 存储库设置,我该如何解决此问题?

terraform github-actions

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

github-actions ×1

terraform ×1