From 9b692c239af2e41cc7ea3be2e7b300a4ece94910 Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 21 Feb 2026 19:20:28 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20chore(ci):=20remove=20unne?= =?UTF-8?q?cessary=20fetch-depth:=200=20from=20workflows=20(#12403)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only 4 checkouts truly need full git history (tag operations, branch sync). The remaining 18 occurrences were used in build/lint/test jobs that only need the current commit. Also removed redundant fetch-tags: true where fetch-depth: 0 already implies full tag fetch. --- .github/workflows/claude-auto-e2e-testing.yml | 9 ++++----- .github/workflows/claude-auto-testing.yml | 2 -- .github/workflows/claude-dedupe-issues.yml | 2 -- .github/workflows/claude-translate-comments.yml | 2 -- .github/workflows/claude-translator.yml | 2 -- .github/workflows/claude.yml | 2 -- .github/workflows/manual-build-desktop.yml | 8 -------- .github/workflows/pr-build-desktop.yml | 8 -------- .github/workflows/pr-build-docker.yml | 4 ---- .github/workflows/release-desktop-beta.yml | 4 ---- .github/workflows/release-desktop-canary.yml | 5 ----- .github/workflows/release-desktop-nightly.yml | 5 ----- .github/workflows/release-desktop-stable.yml | 2 -- .github/workflows/release-docker.yml | 6 +----- .github/workflows/verify-desktop-patch.yml | 4 +--- 15 files changed, 6 insertions(+), 59 deletions(-) diff --git a/.github/workflows/claude-auto-e2e-testing.yml b/.github/workflows/claude-auto-e2e-testing.yml index 90c65a79f8..31b33794c3 100644 --- a/.github/workflows/claude-auto-e2e-testing.yml +++ b/.github/workflows/claude-auto-e2e-testing.yml @@ -21,7 +21,7 @@ env: DATABASE_DRIVER: node KEY_VAULTS_SECRET: LA7n9k3JdEcbSgml2sxfw+4TV1AzaaFU5+R176aQz4s= AUTH_SECRET: e2e-test-secret-key-for-better-auth-32chars! - AUTH_EMAIL_VERIFICATION: "0" + AUTH_EMAIL_VERIFICATION: '0' S3_ACCESS_KEY_ID: e2e-mock-access-key S3_SECRET_ACCESS_KEY: e2e-mock-secret-key S3_BUCKET: e2e-mock-bucket @@ -43,14 +43,13 @@ jobs: POSTGRES_PASSWORD: postgres options: >- --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + ports: - 5432:5432 steps: - name: Checkout repository uses: actions/checkout@v6 - with: - fetch-depth: 1 - name: Setup Bun uses: oven-sh/setup-bun@v2 @@ -67,7 +66,7 @@ jobs: - name: Build application run: bun run build env: - SKIP_LINT: "1" + SKIP_LINT: '1' - name: Configure Git run: | @@ -85,7 +84,7 @@ jobs: uses: anthropics/claude-code-action@v1 with: github_token: ${{ secrets.GH_TOKEN }} - allowed_non_write_users: "*" + allowed_non_write_users: '*' claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} claude_args: | --allowedTools "Bash,Read,Edit,Write,Glob,Grep" diff --git a/.github/workflows/claude-auto-testing.yml b/.github/workflows/claude-auto-testing.yml index 2c63cbe688..66722d40c9 100644 --- a/.github/workflows/claude-auto-testing.yml +++ b/.github/workflows/claude-auto-testing.yml @@ -28,8 +28,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 - with: - fetch-depth: 1 - name: Setup Bun uses: oven-sh/setup-bun@v2 diff --git a/.github/workflows/claude-dedupe-issues.yml b/.github/workflows/claude-dedupe-issues.yml index 763d3e1220..28052204ce 100644 --- a/.github/workflows/claude-dedupe-issues.yml +++ b/.github/workflows/claude-dedupe-issues.yml @@ -21,8 +21,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 - with: - fetch-depth: 1 - name: Copy security prompt run: | diff --git a/.github/workflows/claude-translate-comments.yml b/.github/workflows/claude-translate-comments.yml index a3719ef2f4..74eb0204c7 100644 --- a/.github/workflows/claude-translate-comments.yml +++ b/.github/workflows/claude-translate-comments.yml @@ -28,8 +28,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 - with: - fetch-depth: 1 - name: Configure Git run: | diff --git a/.github/workflows/claude-translator.yml b/.github/workflows/claude-translator.yml index d909997104..4296cf005b 100644 --- a/.github/workflows/claude-translator.yml +++ b/.github/workflows/claude-translator.yml @@ -32,8 +32,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 - with: - fetch-depth: 1 - name: Copy security prompt run: | diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index e4ac348e48..a3e7f6ed59 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -27,8 +27,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 - with: - fetch-depth: 1 - name: Copy security prompt run: | diff --git a/.github/workflows/manual-build-desktop.yml b/.github/workflows/manual-build-desktop.yml index d492d465d3..7dd291b509 100644 --- a/.github/workflows/manual-build-desktop.yml +++ b/.github/workflows/manual-build-desktop.yml @@ -51,8 +51,6 @@ jobs: version: ${{ steps.set_version.outputs.version }} steps: - uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Setup Node.js uses: actions/setup-node@v6 @@ -103,8 +101,6 @@ jobs: os: [macos-latest, macos-15-intel] steps: - uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Setup Node & pnpm uses: ./.github/actions/setup-node-pnpm @@ -181,8 +177,6 @@ jobs: runs-on: windows-2025 steps: - uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Setup build environment uses: ./.github/actions/desktop-build-setup @@ -227,8 +221,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Setup Node & pnpm uses: ./.github/actions/setup-node-pnpm diff --git a/.github/workflows/pr-build-desktop.yml b/.github/workflows/pr-build-desktop.yml index 524c422c68..7067620a4c 100644 --- a/.github/workflows/pr-build-desktop.yml +++ b/.github/workflows/pr-build-desktop.yml @@ -26,8 +26,6 @@ jobs: steps: - name: Checkout base uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Setup Node & Bun uses: ./.github/actions/setup-node-bun @@ -56,8 +54,6 @@ jobs: version: ${{ steps.set_version.outputs.version }} steps: - uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Setup Node.js uses: actions/setup-node@v6 @@ -96,8 +92,6 @@ jobs: os: [macos-latest, macos-15-intel, windows-2025, ubuntu-latest] steps: - uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Setup Node & pnpm uses: ./.github/actions/setup-node-pnpm @@ -286,8 +280,6 @@ jobs: artifact_path: ${{ steps.set_path.outputs.path }} steps: - uses: actions/checkout@v6 - with: - fetch-depth: 0 # 下载合并后的构建产物 - name: Download merged artifacts diff --git a/.github/workflows/pr-build-docker.yml b/.github/workflows/pr-build-docker.yml index e70d165e7a..540147cf7d 100644 --- a/.github/workflows/pr-build-docker.yml +++ b/.github/workflows/pr-build-docker.yml @@ -39,8 +39,6 @@ jobs: - name: Checkout PR branch uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -107,8 +105,6 @@ jobs: steps: - name: Checkout PR branch uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Download digests uses: actions/download-artifact@v7 diff --git a/.github/workflows/release-desktop-beta.yml b/.github/workflows/release-desktop-beta.yml index b93bdb9768..8d9f5abaaa 100644 --- a/.github/workflows/release-desktop-beta.yml +++ b/.github/workflows/release-desktop-beta.yml @@ -61,8 +61,6 @@ jobs: steps: - name: Checkout base uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Setup Node.js uses: actions/setup-node@v6 @@ -91,8 +89,6 @@ jobs: os: [macos-latest, macos-15-intel, windows-2025, ubuntu-latest] steps: - uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Setup build environment uses: ./.github/actions/desktop-build-setup diff --git a/.github/workflows/release-desktop-canary.yml b/.github/workflows/release-desktop-canary.yml index 7882ef90e3..44ea457d29 100644 --- a/.github/workflows/release-desktop-canary.yml +++ b/.github/workflows/release-desktop-canary.yml @@ -52,7 +52,6 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 - fetch-tags: true - name: Check commit message prefix id: check @@ -133,8 +132,6 @@ jobs: steps: - name: Checkout base uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Setup Node.js uses: actions/setup-node@v6 @@ -167,8 +164,6 @@ jobs: os: [macos-15, macos-15-intel, windows-2025, ubuntu-latest] steps: - uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Setup build environment uses: ./.github/actions/desktop-build-setup diff --git a/.github/workflows/release-desktop-nightly.yml b/.github/workflows/release-desktop-nightly.yml index 06d31c4657..0508c824b0 100644 --- a/.github/workflows/release-desktop-nightly.yml +++ b/.github/workflows/release-desktop-nightly.yml @@ -48,7 +48,6 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 - fetch-tags: true - name: Check for code changes since last nightly id: changes @@ -128,8 +127,6 @@ jobs: steps: - name: Checkout base uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Setup Node.js uses: actions/setup-node@v6 @@ -162,8 +159,6 @@ jobs: os: [macos-15, macos-15-intel, windows-2025, ubuntu-latest] steps: - uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Setup build environment uses: ./.github/actions/desktop-build-setup diff --git a/.github/workflows/release-desktop-stable.yml b/.github/workflows/release-desktop-stable.yml index 1faab6a15e..2daafaa18b 100644 --- a/.github/workflows/release-desktop-stable.yml +++ b/.github/workflows/release-desktop-stable.yml @@ -176,8 +176,6 @@ jobs: matrix: ${{ fromJson(needs.configure-build.outputs.matrix) }} steps: - uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Setup build environment uses: ./.github/actions/desktop-build-setup diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml index 406cbac64f..59b8a2277a 100644 --- a/.github/workflows/release-docker.yml +++ b/.github/workflows/release-docker.yml @@ -3,7 +3,7 @@ permissions: contents: read on: - workflow_dispatch: + workflow_dispatch: {} release: types: [published] @@ -33,8 +33,6 @@ jobs: - name: Checkout base uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -93,8 +91,6 @@ jobs: steps: - name: Checkout base uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Download digests uses: actions/download-artifact@v7 diff --git a/.github/workflows/verify-desktop-patch.yml b/.github/workflows/verify-desktop-patch.yml index a40000f4ca..077412d045 100644 --- a/.github/workflows/verify-desktop-patch.yml +++ b/.github/workflows/verify-desktop-patch.yml @@ -23,7 +23,7 @@ on: - 'src/components/mdx/**' - 'src/features/DevPanel/**' - 'src/server/translation.ts' - workflow_dispatch: + workflow_dispatch: {} permissions: contents: read @@ -39,8 +39,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Setup Node & Bun uses: ./.github/actions/setup-node-bun