Skip to content

Commit 7e02fee

Browse files
appleboyclaude
andauthored
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>
1 parent ca58dd0 commit 7e02fee

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,20 @@ jobs:
793793
echo "Output contains 'True'"
794794
fi
795795
796+
windows-binary-download:
797+
runs-on: windows-latest
798+
steps:
799+
- name: Checkout code
800+
uses: actions/checkout@v7
801+
802+
- name: test binary download and checksum verification
803+
shell: bash
804+
run: |
805+
export GITHUB_ACTION_PATH="$PWD"
806+
export INPUT_CURL_INSECURE=false
807+
export INPUT_CAPTURE_STDOUT=false
808+
./entrypoint.sh --help
809+
796810
testing-script-error:
797811
runs-on: ubuntu-latest
798812
steps:

entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ function detect_client_info() {
2626

2727
case "${CLIENT_PLATFORM}" in
2828
darwin | linux | windows) ;;
29+
# Git Bash / MSYS2 / Cygwin on Windows runners report e.g. MINGW64_NT-10.0
30+
mingw* | msys* | cygwin*) CLIENT_PLATFORM="windows" ;;
2931
*) log_error "Unknown or unsupported platform: ${CLIENT_PLATFORM}. Supported platforms are Linux, Darwin, and Windows." "${ERR_UNKNOWN_PLATFORM}" ;;
3032
esac
3133

@@ -39,6 +41,10 @@ function detect_client_info() {
3941
detect_client_info
4042
DOWNLOAD_URL_PREFIX="${DRONE_SSH_RELEASE_URL}/v${DRONE_SSH_VERSION}"
4143
CLIENT_BINARY="drone-ssh-${DRONE_SSH_VERSION}-${CLIENT_PLATFORM}-${CLIENT_ARCH}"
44+
# Windows release assets are published with an .exe suffix
45+
if [[ "${CLIENT_PLATFORM}" == "windows" ]]; then
46+
CLIENT_BINARY="${CLIENT_BINARY}.exe"
47+
fi
4248
TARGET="${GITHUB_ACTION_PATH}/${CLIENT_BINARY}"
4349

4450
# Check if binary already exists and is executable (caching)

0 commit comments

Comments
 (0)