diff --git a/.github/workflows/manual-build-pro-image.yml b/.github/workflows/manual-build-pro-image.yml index 9114dff65..fbddf5f7a 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"