Skip to content

Commit 4c37c08

Browse files
committed
trying to get the key ... again
1 parent b3ead2f commit 4c37c08

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,30 +126,31 @@ jobs:
126126
fi
127127
128128
129+
129130
# Find the first non-comment line (actual key) in hostkey.txt
130131
KEYLINE=$(grep -v '^#' hostkey.txt | head -n 1)
131132
if echo "$KEYLINE" | grep -q 'ssh-ed25519'; then
132-
KEYTYPE="ed25519"
133+
KEYTYPE="ssh-ed25519"
133134
elif echo "$KEYLINE" | grep -q 'ecdsa'; then
134-
KEYTYPE="ecdsa"
135+
KEYTYPE="ecdsa-sha2-nistp256"
135136
elif echo "$KEYLINE" | grep -q 'ssh-rsa'; then
136-
KEYTYPE="rsa"
137+
KEYTYPE="ssh-rsa"
137138
else
138139
echo "ERROR: Unknown key type in hostkey.txt: $KEYLINE"
139140
cat hostkey.txt
140141
exit 1
141142
fi
142143
143-
# Extract the fingerprint for the detected key type (from the first matching key line)
144-
FINGERPRINT=$(ssh-keygen -l -f hostkey.txt | grep -i "$KEYTYPE" | head -n 1 | awk '{print $2}')
145-
if [ -z "$FINGERPRINT" ]; then
146-
echo "ERROR: Could not extract fingerprint for $KEYTYPE from hostkey.txt"
144+
# Extract the full key string for the detected key type
145+
FULLKEY=$(grep -v '^#' hostkey.txt | grep "$KEYTYPE" | head -n 1 | awk '{print $1 " " $2}')
146+
if [ -z "$FULLKEY" ]; then
147+
echo "ERROR: Could not extract full key for $KEYTYPE from hostkey.txt"
147148
cat hostkey.txt
148149
exit 1
149150
fi
150151
151-
# Add the host key to PuTTY's cache using plink.exe
152-
./plink.exe -ssh -hostkey "$FINGERPRINT" "$SFTP_HOST" exit || true
152+
# Add the host key to PuTTY's cache using plink.exe (must use full key string, not fingerprint)
153+
./plink.exe -ssh -hostkey "$FULLKEY" "$SFTP_HOST" exit || true
153154
154155
# Clean up
155156
rm -f hostkey.txt

0 commit comments

Comments
 (0)