Replace actions/checkout with instance git clone (github.com unreachable from runner)
build-and-release / build (push) Successful in 4s
build-and-release / build (push) Successful in 4s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user