From 3bb51b39c41cd9113e52a51a55379ad0bcea6c15 Mon Sep 17 00:00:00 2001 From: ibuler Date: Sat, 14 Sep 2024 16:49:59 +0800 Subject: [PATCH] perf: github action fetch branches --- .github/workflows/build-base-image.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-base-image.yml b/.github/workflows/build-base-image.yml index ef0d91cad..dec5b8466 100644 --- a/.github/workflows/build-base-image.yml +++ b/.github/workflows/build-base-image.yml @@ -6,13 +6,18 @@ on: - 'pr*' jobs: - check_change: + check-deps-change: runs-on: ubuntu-latest outputs: should_skip: ${{ steps.set_skip_flag.outputs.should_skip }} # 输出 should_skip 标志 steps: - - name: Checkout repository - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 # 确保检出完整历史 + + - name: Fetch all branches + run: git fetch --all # 拉取所有分支 - name: Check conditions id: set_skip_flag @@ -26,8 +31,8 @@ jobs: build-and-push: runs-on: ubuntu-latest - needs: check_change # 依赖 check_skip job 的执行结果 - if: needs.check_change.outputs.should_skip != 'true' + needs: check-deps-change # 依赖 check_skip job 的执行结果 + if: needs.check-deps-change.outputs.should_skip != 'true' steps: - name: Checkout repository uses: actions/checkout@v4