小编Adr*_*lez的帖子

通过 Github Actions CI/CD 访问服务器时 Git 权限被拒绝(公钥)

当我通过本地计算机连接到服务器时,我可以使用 ssh 成功连接到 Github。

我使用教程来设置 ssh 密钥。

但是,当使用 Github 操作时,我收到此错误:

err: git@github.com: Permission denied (publickey).
err: fatal: Could not read from remote repository.
err: 
err: Please make sure you have the correct access rights
err: and the repository exists.
Run Code Online (Sandbox Code Playgroud)

这是我的 Github 操作 YML:

name: CI App to DO

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  deploy-do:
    runs-on: ubuntu-latest
    steps:
      - name: SSH to server and Deploy App
        uses: appleboy/ssh-action@master
        with:
          host: ${{ secrets.SSH_HOST }}
          username: ${{ secrets.SSH_USERNAME …
Run Code Online (Sandbox Code Playgroud)

git ubuntu github github-actions

19
推荐指数
2
解决办法
2万
查看次数

4
推荐指数
1
解决办法
381
查看次数