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"