From e9443574d8bc035fc3e01222d9dac0361af04633 Mon Sep 17 00:00:00 2001 From: chenos Date: Mon, 22 Jul 2024 17:28:48 +0800 Subject: [PATCH] fix: build image ci (#4929) * fix: ci * fix: ci --- .github/workflows/build-pro-image.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-pro-image.yml b/.github/workflows/build-pro-image.yml index 54423c648bb..5cacdd6c621 100644 --- a/.github/workflows/build-pro-image.yml +++ b/.github/workflows/build-pro-image.yml @@ -9,6 +9,7 @@ on: branches: - 'main' - 'next' + - 'next-test' paths: - 'packages/**' - 'docker/nocobase/**' @@ -36,15 +37,19 @@ jobs: repository: nocobase/pro-plugins ref: main path: packages/pro-plugins + fetch-depth: 0 ssh-key: ${{ secrets.SUBMODULE_SSH_KEY }} - - name: Fetch all branches - run: cd packages/pro-plugins && git fetch --all - - name: git checkout ${{ github.event.pull_request.base.ref }} - run: cd packages/pro-plugins && git checkout ${{ github.event.pull_request.base.ref }} - continue-on-error: true - - name: git checkout ${{ github.head_ref || github.ref_name }} - run: cd packages/pro-plugins && git checkout ${{ github.head_ref || github.ref_name }} - continue-on-error: true + - run: | + cd packages/pro-plugins && + if git show-ref --quiet refs/remotes/origin/${{ github.head_ref || github.ref_name }}; then + git checkout ${{ github.head_ref || github.ref_name }} + else + if git show-ref --quiet refs/remotes/origin/${{ github.event.pull_request.base.ref }}; then + git checkout ${{ github.event.pull_request.base.ref }} + else + git checkout main + fi + fi - name: rm .git run: rm -rf packages/pro-plugins/.git && git config --global user.email "you@example.com" && git config --global user.name "Your Name" && git add -A && git commit -m "tmp commit" - name: Set up QEMU