fac*_*tor 9 git ubuntu github command-line-interface github-actions
我在 GitHub 上有一个私有存储库,我的目标是每当有新提交时,我们都会在 VPS 上更新存储库。

问题在于存储库是私有的并且需要身份验证。我尝试在全局 git 配置中设置我的用户名和密码,但即使这样做之后,它仍然需要身份验证。
fac*_*tor 10
我自己想出了解决方案。我所做的各种事情的问题如下。我试图做一些类似的事情git pull https://${{ secrets.TOKEN }}@github.com/repo
解决方案是将整个命令git pull https://token@github.com/repo作为秘密,然后运行脚本:${{ secrets.SCRIPT }}通过 SSH。
我在最后的行动:
name: Remote SSH
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.IP }}
username: ${{ secrets.USER }}
password: ${{ secrets.PRIVATE_KEY }}
port: ${{ secrets.PORT }}
script: |
cd Repository
${{ secrets.SCRIPT}}
pm2 restart 0
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8310 次 |
| 最近记录: |