From e4b3546583e96d1367ffa6f844a5d52ef6b98f84 Mon Sep 17 00:00:00 2001 From: Junyi Date: Mon, 8 Jul 2024 22:13:35 +0800 Subject: [PATCH] fix(ci): fix ci script error for pro (#4845) * fix(ci): fix ci script error on pro * fix(ci): fix ci script * feat(ci): add base branch input for main repo * test(ci): test pr branch number * test(ci): test pr branch number --- .github/workflows/manual-build-pro-image.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/manual-build-pro-image.yml b/.github/workflows/manual-build-pro-image.yml index 9114dff650..fbddf5f7a4 100644 --- a/.github/workflows/manual-build-pro-image.yml +++ b/.github/workflows/manual-build-pro-image.yml @@ -7,6 +7,10 @@ concurrency: on: workflow_dispatch: inputs: + base_branch: + description: 'Please enter a base branch for main repo' + required: true + default: 'main' pr_number: description: 'Please enter a pull request number' required: true @@ -24,14 +28,21 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: + ref: ${{ github.event.inputs.base_branch }} ssh-key: ${{ secrets.SUBMODULE_SSH_KEY }} submodules: true + - name: Set PR branch + id: set_pro_pr_branch + if: inputs.pr_number != 'main' + run: echo "pr_branch=refs/pull/${{ github.event.inputs.pr_number }}/head" >> $GITHUB_OUTPUT + - name: Echo PR branch + run: echo "${{ steps.set_pro_pr_branch.outputs.pr_branch }}" - name: Checkout pro-plugins uses: actions/checkout@v3 with: repository: nocobase/pro-plugins path: packages/pro-plugins - ref: ${{ inputs.pr_number != 'main' && 'refs/pull/' + inputs.pr_number + '/head' || 'main' }} + ref: ${{ steps.set_pro_pr_branch.outputs.pr_branch || 'main' }} ssh-key: ${{ secrets.SUBMODULE_SSH_KEY }} - 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"