Fix: Add base64 decoding support for SSH key

This commit is contained in:
Bu5hm4nn
2026-03-23 18:25:53 +01:00
parent ce1a2ddc97
commit 571ca36ed5

View File

@@ -138,7 +138,13 @@ jobs:
- name: Setup SSH key
run: |
printf '%s' "$DEPLOY_SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_ed25519
# Handle base64-encoded key (recommended) or raw key
mkdir -p ~/.ssh && chmod 700 ~/.ssh
if echo "$DEPLOY_SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/id_ed25519 2>/dev/null; then
echo "Decoded base64 key"
else
printf '%s\n' "$DEPLOY_SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
fi
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -p "${DEPLOY_PORT:-22}" "${DEPLOY_HOST}" >> ~/.ssh/known_hosts 2>/dev/null || true