From 346fe607fe2db6d318b15614ccfa8a943b2eab00 Mon Sep 17 00:00:00 2001 From: Sun Serega Date: Wed, 28 Aug 2024 09:34:15 +0200 Subject: [PATCH] use token for manual clone --- .github/workflows/upstream pretest.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upstream pretest.yaml b/.github/workflows/upstream pretest.yaml index d73dd901..9c031147 100644 --- a/.github/workflows/upstream pretest.yaml +++ b/.github/workflows/upstream pretest.yaml @@ -466,8 +466,14 @@ jobs: $main_repo_url = '${{ github.server_url }}/${{ github.repository }}' $main_repo_branch = '${{ github.event.repository.default_branch }}' Write-Host "Cloning main repo [$main_repo_url]: branch [$main_repo_branch]" - git clone -b $main_repo_branch --filter=tree:0 --no-progress --no-checkout $main_repo_url . - if (-not $?) { throw "git clone failed" } + git init + if (-not $?) { throw "git init failed" } + git remote add origin $main_repo_url + if (-not $?) { throw "git remote add failed" } + git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic ${{ secrets.GITHUB_TOKEN }}" + if (-not $?) { throw "git config failed" } + git fetch --depth=1 origin $main_repo_branch --filter=tree:0 --no-progress + if (-not $?) { throw "git fetch failed" } # git branch -r