fix: update shell wrapper registration to use directory path and improve echo statements

This commit is contained in:
Karolis2011 2025-11-20 00:15:52 +02:00
parent 8b0eaf3b2a
commit 91e3790b1b

View file

@ -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="$(mktemp "$WRAPPER_DIR/ssh-remote-shell-XXXXXX.sh")"
WRAPPER_PATH=${mktemp "$WRAPPER_DIR/ssh-remote-shell-XXXXXX.sh"}
cat << 'WRAPPER_EOF' > "$WRAPPER_PATH"
#!/bin/bash
@ -207,10 +207,8 @@ runs:
if: inputs.use-shell-wrapper == 'true'
shell: bash
run: |
SHELL_WRAPPER_PATH="${{ steps.setup-shell-wrapper.outputs.shell-wrapper-path }}"
# 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"
SHELL_WRAPPER_DIR="${{ steps.setup-shell-wrapper.outputs.shell-wrapper-dir }}"
# Register custom shell for this job
echo "Adding custom shell 'ssh-remote' to PATH"
echo "PATH=$SHELL_WRAPPER_DIR:$PATH" >> $GITHUB_ENV
echo "✅ Custom shell 'ssh-remote' registered for this job"