From 50e97c4a70be505e8654309728e2d1e19638c80c Mon Sep 17 00:00:00 2001 From: "Gan, Jimmy" Date: Thu, 7 May 2026 13:03:56 +0800 Subject: [PATCH] fix: replace actions/checkout@v4 with local git clone from Gitea CI runner in China can't reach GitHub to download the checkout action. Clone directly from internal Gitea container (http://gitea:3000) instead. Co-Authored-By: Claude Opus 4.7 --- .gitea/workflows/deploy-claude-dev-dev.yml | 7 ++++--- .gitea/workflows/deploy-dev.yml | 21 ++++++++++++--------- .gitea/workflows/deploy.yml | 21 ++++++++++++--------- .gitea/workflows/test.yml | 21 ++++++++++++--------- 4 files changed, 40 insertions(+), 30 deletions(-) diff --git a/.gitea/workflows/deploy-claude-dev-dev.yml b/.gitea/workflows/deploy-claude-dev-dev.yml index 3d93925..dde67e1 100644 --- a/.gitea/workflows/deploy-claude-dev-dev.yml +++ b/.gitea/workflows/deploy-claude-dev-dev.yml @@ -20,9 +20,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: ${{ github.sha }} + run: | + if [ ! -d .git ]; then + git clone --branch "${GITHUB_REF_NAME}" --depth=1 "http://gitea:3000/${GITHUB_REPOSITORY}.git" . + fi - name: Resolve image tags run: | diff --git a/.gitea/workflows/deploy-dev.yml b/.gitea/workflows/deploy-dev.yml index 784ef58..2d157f3 100644 --- a/.gitea/workflows/deploy-dev.yml +++ b/.gitea/workflows/deploy-dev.yml @@ -20,9 +20,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 + run: | + if [ ! -d .git ]; then + git clone --depth=1 "http://gitea:3000/${GITHUB_REPOSITORY}.git" . + fi - name: Setup Python run: | @@ -92,9 +93,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 + run: | + if [ ! -d .git ]; then + git clone --depth=1 "http://gitea:3000/${GITHUB_REPOSITORY}.git" . + fi - name: Setup Node.js run: | @@ -153,9 +155,10 @@ jobs: needs: [backend-tests, frontend-tests] steps: - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 + run: | + if [ ! -d .git ]; then + git clone --depth=1 "http://gitea:3000/${GITHUB_REPOSITORY}.git" . + fi - name: Warm mirror cache for base images run: | diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 4f0b0f2..d68be30 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -19,9 +19,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 + run: | + if [ ! -d .git ]; then + git clone --depth=1 "http://gitea:3000/${GITHUB_REPOSITORY}.git" . + fi - name: Setup Python run: | @@ -96,9 +97,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 + run: | + if [ ! -d .git ]; then + git clone --depth=1 "http://gitea:3000/${GITHUB_REPOSITORY}.git" . + fi - name: Setup Node.js run: | @@ -167,9 +169,10 @@ jobs: - /volume1/docker/nas-dashboard:/nas-dashboard steps: - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 + run: | + if [ ! -d .git ]; then + git clone --depth=1 "http://gitea:3000/${GITHUB_REPOSITORY}.git" . + fi - name: Warm mirror cache for base images run: | diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 2a091df..dffead3 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -14,9 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 + run: | + if [ ! -d .git ]; then + git clone "http://gitea:3000/${GITHUB_REPOSITORY}.git" . + fi continue-on-error: true - name: Run gitleaks @@ -38,9 +39,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 + run: | + if [ ! -d .git ]; then + git clone --depth=1 "http://gitea:3000/${GITHUB_REPOSITORY}.git" . + fi - name: Setup Python run: | @@ -133,9 +135,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 + run: | + if [ ! -d .git ]; then + git clone --depth=1 "http://gitea:3000/${GITHUB_REPOSITORY}.git" . + fi - name: Setup Node.js run: |