Replace actions/checkout with instance git clone (github.com unreachable from runner)
build-and-release / build (push) Successful in 4s

This commit is contained in:
2026-07-20 12:23:20 +08:00
parent a9a554ac69
commit 4c16e58e6b
2 changed files with 22 additions and 2 deletions
+9 -1
View File
@@ -10,8 +10,16 @@ jobs:
build:
runs-on: windows-latest
steps:
# runner 到 github.com 网络不稳定,不使用 actions/checkout@v4
# 改为直接从本 Gitea 实例克隆代码
- name: Checkout
uses: actions/checkout@v4
shell: pwsh
env:
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$url = "${{ gitea.server_url }}/${{ github.repository }}.git" -replace '^https://', "https://x-access-token:$env:GITEA_TOKEN@"
git clone $url .
git checkout ${{ github.sha }}
- name: Install dependencies
run: npm ci