From 5f7b4d0c8f03fb6fd021ce44c145e385cfa5526e Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 26 Nov 2026 08:27:04 +0000 Subject: [PATCH] fix(plugin): read a mirror key pasted with CRLF line ends, and say when the key is unreadable Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_019SAKipREuKRNW28N1gsAuR --- .github/workflows/plugin-mirror.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/plugin-mirror.yml b/.github/workflows/plugin-mirror.yml index b307fc876..2fd4acaf7 100644 --- a/.github/workflows/plugin-mirror.yml +++ b/.github/workflows/plugin-mirror.yml @@ -84,8 +84,14 @@ jobs: exit 0 fi install -m 700 -d ~/.ssh - printf '%s\n' "$DEPLOY_KEY" > ~/.ssh/mirror_key + # A key pasted into the secret from Windows carries CRLF line ends, + # which OpenSSH refuses ("error in libcrypto"). + printf '%s\n' "$DEPLOY_KEY" | tr -d '\r' > ~/.ssh/mirror_key chmod 600 ~/.ssh/mirror_key + if ! ssh-keygen -y -f ~/.ssh/mirror_key > /dev/null; then + echo "::error::PLUGIN_MIRROR_DEPLOY_KEY is not a readable private key. Paste the whole private key file, from its BEGIN line to its END line." + exit 1 + fi ssh-keyscan github.com >> ~/.ssh/known_hosts 2>/dev/null export GIT_SSH_COMMAND="ssh -i ~/.ssh/mirror_key -o IdentitiesOnly=yes"