mirror of
https://github.com/appleboy/ssh-action.git
synced 2026-08-22 08:33:07 +01:00
fix: append .exe suffix to Windows binary download filename (#418)
* fix: append .exe suffix to Windows binary download filename The drone-ssh release publishes Windows assets with an .exe suffix (e.g. drone-ssh-1.8.2-windows-amd64.exe), but entrypoint.sh built the download filename without it, so every Windows runner failed with a 404 at the download step (ERR_DOWNLOAD_FAILED). Append .exe when the detected platform is windows. This also keeps the checksums.txt lookup working on Windows since entries match the exact asset name. Add a windows-latest CI job that exercises the download, checksum verification, and binary execution path. Fixes #417 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: detect Git Bash/MSYS/Cygwin uname output as windows platform On windows-latest runners, bash steps run under Git Bash where uname -s reports MINGW64_NT-10.0-<build>, so platform detection rejected Windows runners with ERR_UNKNOWN_PLATFORM before the download step was even reached. Map mingw*/msys*/cygwin* to windows. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,8 @@ function detect_client_info() {
|
||||
|
||||
case "${CLIENT_PLATFORM}" in
|
||||
darwin | linux | windows) ;;
|
||||
# Git Bash / MSYS2 / Cygwin on Windows runners report e.g. MINGW64_NT-10.0
|
||||
mingw* | msys* | cygwin*) CLIENT_PLATFORM="windows" ;;
|
||||
*) log_error "Unknown or unsupported platform: ${CLIENT_PLATFORM}. Supported platforms are Linux, Darwin, and Windows." "${ERR_UNKNOWN_PLATFORM}" ;;
|
||||
esac
|
||||
|
||||
@@ -39,6 +41,10 @@ function detect_client_info() {
|
||||
detect_client_info
|
||||
DOWNLOAD_URL_PREFIX="${DRONE_SSH_RELEASE_URL}/v${DRONE_SSH_VERSION}"
|
||||
CLIENT_BINARY="drone-ssh-${DRONE_SSH_VERSION}-${CLIENT_PLATFORM}-${CLIENT_ARCH}"
|
||||
# Windows release assets are published with an .exe suffix
|
||||
if [[ "${CLIENT_PLATFORM}" == "windows" ]]; then
|
||||
CLIENT_BINARY="${CLIENT_BINARY}.exe"
|
||||
fi
|
||||
TARGET="${GITHUB_ACTION_PATH}/${CLIENT_BINARY}"
|
||||
|
||||
# Check if binary already exists and is executable (caching)
|
||||
|
||||
Reference in New Issue
Block a user