From bdef82dc9368d17ebb15cc45e5e0d3f8da134aca Mon Sep 17 00:00:00 2001 From: Anyon Date: Fri, 8 May 2026 17:02:01 +0800 Subject: [PATCH] =?UTF-8?q?ci(split):=20=E7=BC=BA=E5=B0=91=E6=8B=86?= =?UTF-8?q?=E5=88=86=E5=AF=86=E9=92=A5=E6=97=B6=E8=B7=B3=E8=BF=87=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 避免新仓库尚未配置 SPLIT_PRIVATE_KEY 时,v6-dev 与 v8-dev 的 Split Repositories 工作流直接失败。 主要内容: - 增加拆分密钥预检查步骤。 - 未配置 SPLIT_PRIVATE_KEY 时输出 GitHub Actions warning 并跳过 Setup Private Key 与 Split And Push。 - 配置密钥后自动恢复插件仓库拆分推送流程。 --- .github/workflows/split.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/split.yml b/.github/workflows/split.yml index 7a141fc4f..cd38c8ccf 100644 --- a/.github/workflows/split.yml +++ b/.github/workflows/split.yml @@ -33,9 +33,19 @@ jobs: *) echo "Unsupported split branch: ${GITHUB_REF_NAME}" >&2; exit 1 ;; esac - - name: Setup Private Key + - name: Check Split Secret + id: split_secret + run: | + if [ -z "$SSH_PRIVATE_KEY" ]; then + echo "::warning title=Skip Split::Repository secret SPLIT_PRIVATE_KEY is not configured, skip plugin repository split." + echo "enabled=false" >> "$GITHUB_OUTPUT" + else + echo "enabled=true" >> "$GITHUB_OUTPUT" + fi + + - name: Setup Private Key + if: steps.split_secret.outputs.enabled == 'true' run: | - test -n "$SSH_PRIVATE_KEY" mkdir -p ~/.ssh echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa @@ -43,6 +53,7 @@ jobs: echo "StrictHostKeyChecking no" >> ~/.ssh/config - name: Split And Push + if: steps.split_secret.outputs.enabled == 'true' run: | git config pull.rebase true git config --global user.name "Anyon"