在 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 存储库设置,我该如何解决此问题?