From 03d7a679990ed3fa498bf1cc9b2bdbd543874879 Mon Sep 17 00:00:00 2001 From: xilesun <2013xile@gmail.com> Date: Mon, 21 Oct 2024 20:47:06 +0800 Subject: [PATCH] chore(ci): fix changelog-and-release.yml --- .github/workflows/changelog-and-release.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/changelog-and-release.yml b/.github/workflows/changelog-and-release.yml index 4030cce619..4567e26fb1 100644 --- a/.github/workflows/changelog-and-release.yml +++ b/.github/workflows/changelog-and-release.yml @@ -34,11 +34,19 @@ jobs: run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" env: GH_TOKEN: ${{ steps.app-token.outputs.token }} + - name: Get branch + id: get-branch + run: | + if [[ "${{ inputs.version }}" == "alpha" ]]; then + echo "branch=$(echo 'next')" >> $GITHUB_OUTPUT + else + echo "branch=$(echo 'main')" >> $GITHUB_OUTPUT + fi - name: Checkout uses: actions/checkout@v4 with: repository: nocobase/nocobase - ref: ${{ github.head_ref || github.ref_name }} + ref: ${{ steps.get-branch.outputs.branch }} token: ${{ steps.app-token.outputs.token }} persist-credentials: true fetch-depth: 0 @@ -47,7 +55,7 @@ jobs: with: repository: nocobase/pro-plugins path: packages/pro-plugins - ref: ${{ github.head_ref || github.ref_name }} + ref: ${{ steps.get-branch.outputs.branch }} fetch-depth: 0 token: ${{ steps.app-token.outputs.token }} persist-credentials: true @@ -56,7 +64,7 @@ jobs: run: | for repo in ${{ join(fromJSON(vars.PRO_PLUGIN_REPOS), ' ') }} do - git clone -b ${{ github.head_ref || github.ref_name }} https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/nocobase/$repo.git packages/pro-plugins/@nocobase/$repo + git clone -b ${{ steps.get-branch.outputs.branch }} https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/nocobase/$repo.git packages/pro-plugins/@nocobase/$repo done - name: Set user run: |