github - GitHub Actions 无法通过 SSH 加载,尽管它似乎使用 ssh-access 工作
问题描述
我正在执行 github 操作以在我的 PR 上运行测试并推送,但我无法确保测试能够访问我的私人存储库。
我已经测试了我在本地使用的 SSH 凭据,它们 100% 有效。
https://github.com/webfactory/ssh-agent
这是我正在使用的 SSH 代理。
这是我的 github 操作
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches:
- master
- release/*
pull_request:
branches:
- master
- release/*
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
steps:
- uses: actions/checkout@v2
- uses: webfactory/ssh-agent@v0.4.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
它似乎没有尝试使用它获得的 SSH 密钥
解决方案
由于https://github.com/Tixpire/tixpire-server似乎是私有的,因此您需要使用PAT(个人访问令牌)来访问它。
另请参阅操作/结帐问题 95。
它是一个 HTTPS URL,所以没有多少 SSH 密钥可以工作:你需要一个 SSH URL (git@github.com:Tixpire/tixpire-server
)
推荐阅读
- javascript - 如何等待一个变量改变它的角度值?
- c++ - QT creator 上的应用程序如何调用使用 gcc 编译的静态库?
- r - 使用 dplyr--column 进行问题编程,这绝对是一个被作为公式提取的向量
- javascript - React Native 5.x 传参工作示例
- bash - 使用 bash 将日期保存为 json 格式的文件
- html - 如何在wordpress中删除目录访问
- python - Python matplotlib.pyplot Bigram Plot 作为 Plotly Plot
- c++ - 如何绑定地址可能更改的实例的成员函数?
- django - 如何删除 django 用户模型中的名字和姓氏列?
- c# - 无法将 Excel 文件上传到 Azure 存储 Blob