在 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
错误信息:
git@github.com: 拒绝访问(publickey)。
我看到很多关于添加ssh密钥的帖子,但那是在本地操作,而不是在从Github操作运行的Ubuntu版本上 - 我在这里缺少什么?我无法生成ssh密钥,并即时将私钥添加到Github存储库设置中,我应该如何解决这个问题?
PAT
。 - peterevans