mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-06-06 20:18:10 +08:00
ci(split): 缺少拆分密钥时跳过插件同步
避免新仓库尚未配置 SPLIT_PRIVATE_KEY 时,v6-dev 与 v8-dev 的 Split Repositories 工作流直接失败。 主要内容: - 增加拆分密钥预检查步骤。 - 未配置 SPLIT_PRIVATE_KEY 时输出 GitHub Actions warning 并跳过 Setup Private Key 与 Split And Push。 - 配置密钥后自动恢复插件仓库拆分推送流程。
This commit is contained in:
parent
e7a8c05556
commit
bdef82dc93
15
.github/workflows/split.yml
vendored
15
.github/workflows/split.yml
vendored
@ -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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user