From 8b0eaf3b2a14300b5c0f6862f0e2029f433c5044 Mon Sep 17 00:00:00 2001 From: Karolis2011 Date: Thu, 20 Nov 2025 00:14:48 +0200 Subject: [PATCH] fix: mktemp wrapper creation and register custom shell via mapping --- action.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index deed5eb..8edb067 100644 --- a/action.yml +++ b/action.yml @@ -157,7 +157,7 @@ runs: TEMP_DIR="${RUNNER_TEMP:-/tmp}" WRAPPER_DIR=$(mktemp -d "$TEMP_DIR/setup-ssh-client-XXXXXX") mkdir -p "$WRAPPER_DIR" - WRAPPER_PATH="$WRAPPER_DIR/ssh-remote-shell.sh" + WRAPPER_PATH="$(mktemp "$WRAPPER_DIR/ssh-remote-shell-XXXXXX.sh")" cat << 'WRAPPER_EOF' > "$WRAPPER_PATH" #!/bin/bash @@ -180,6 +180,7 @@ runs: # Execute script on remote server # Use BatchMode to prevent interactive prompts # ConnectTimeout to fail fast if connection issues + echo "Executing script on remote server '${{ inputs.ssh-host }}' via SSH..." ssh -o BatchMode=yes \ -o ConnectTimeout=10 \ github-action-host \ @@ -207,8 +208,9 @@ runs: shell: bash run: | SHELL_WRAPPER_PATH="${{ steps.setup-shell-wrapper.outputs.shell-wrapper-path }}" - # Register custom shell for this job by setting a custom shell mapping - # in $GITHUB_ENV. This maps the shell name to the path. The runner will - # use the provided script path when 'shell: ssh-remote' is used in steps. + # Register custom shell for this job by mapping the shell name to the + # wrapper path. This is the recommended way to expose a custom shell + # for `shell: ssh-remote` in subsequent steps. We do this conditionally + # so `use-shell-wrapper` can be used to opt out. echo "ssh-remote=$SHELL_WRAPPER_PATH {0}" >> "$GITHUB_ENV" echo "✅ Custom shell 'ssh-remote' registered for this job"