簡體   English   中英

如何 git 使用 github 操作工作流程拉原點

[英]How to git pull origin with github Actions workflow

我是 github 操作工作流程的新手

我有一個自托管的跑步者,我克隆了一個名為xxx的倉庫

我想在操作工作流程中執行git pull origin branchYY ,以便本地倉庫與 xxx 倉庫的遠程分支“branchYY”保持最新

我嘗試了以下工作流程:

name: Pull origin branchYY
on:
  push:
    branches:
      - branchYY
jobs:
  auto-pull:
    name: PullOriginBranchYY
    runs-on: self-hosted
    steps:
    - uses: actions/checkout@v2
    - run: |
        git config user.name johnn
        git config user.email soemthing@mail.com
        git config github.token ${{ secrets.GITHUB_TOKEN }}
        git pull origin branchYY
      working-directory: /home/user/repos/xxx

但是本地跑步者提示:

“https://github.com”的用戶名:

我不明白為什么它不進行身份驗證?

正如文檔所說( https://github.com/marketplace/actions/checkout ),您應該使用正確的參數配置令牌。 我建議你使用 ssh 來克隆

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM