@@ -121,8 +121,44 @@ jobs:
121121 docusaurus-build :
122122 runs-on : ubuntu-latest
123123 needs : markdownlint # Only runs if markdownlint passes!
124+ env :
125+ PR_NUMBER : ${{ github.event.number }}
124126 steps :
125127
128+
129+ # 1. Replicate the branch info and complex checkout logic
130+ - name : clean
131+ run : |
132+ rm -rf ${{ github.workspace }}
133+ mkdir -p ${{ github.workspace }}
134+
135+ - name : BRANCH INFO
136+ id : branch
137+ run : |
138+ echo "branch=${{github.base_ref}}" >> $GITHUB_OUTPUT
139+
140+ - uses : actions/checkout@v4
141+ with :
142+ fetch-depth : 0
143+
144+ - name : Checkout PR
145+ run : |
146+ BRANCH=${{steps.branch.outputs.branch}}
147+ git config --global user.name "docs-automation[bot]"
148+ git config --global user.email "docs-automation[bot]@starrocks.io"
149+ git checkout $BRANCH
150+ git pull
151+ BRANCH_NAME="${BRANCH}-${PR_NUMBER}"
152+ git fetch origin pull/${PR_NUMBER}/head:${BRANCH_NAME}
153+ git checkout $BRANCH_NAME
154+ git checkout -b merge_pr
155+ git merge --squash --no-edit ${BRANCH} || (echo "::error::Merge conflict, please check." && exit -1)
156+
157+ # 2. Replicate the Node.js setup
158+ - uses : actions/setup-node@v4
159+ with :
160+ node-version : 24
161+
126162 - name : docusaurus-mdx-checker
127163 run : |
128164 npx docusaurus-mdx-checker -c docs
@@ -135,6 +171,8 @@ jobs:
135171 args : >
136172 --config docs/lychee.toml
137173 --offline "docs/**/*.md"
174+
175+ # 3. Your original Docusaurus build logic
138176 - name : Docusaurus build
139177 env :
140178 NODE_OPTIONS : --max-old-space-size=8192
@@ -143,7 +181,7 @@ jobs:
143181 working-directory : ./docs/docusaurus
144182 run : |
145183 rm -rf ./docs
146- rm -rf ./i18n/zh/docusaurus-plugin-content-dos /current
184+ rm -rf ./i18n/zh/docusaurus-plugin-content-docs /current
147185 mkdir -p ./i18n/zh/docusaurus-plugin-content-docs
148186 mv ../en ./docs
149187 rm -rf ./docs/release_notes ./docs/ecosystem_release
0 commit comments