ssh-deploy-action/action.yml
butterrobot 255caf01d1 fix: entrypoint.sh is not executable, every run fails with exit 126 (#1)
entrypoint.sh is committed with mode 0644 while action.yml runs it directly as `${{ github.action_path }}/entrypoint.sh`, so the action fails before the script starts with 'entrypoint.sh: Permission denied' and exitcode 126 — the SSH key is never read, which makes it look like an auth failure. Sets the exec bit, and also invokes via 'sh' so the action no longer depends on the mode bit surviving a checkout. Found while deploying fmartingr/fmartingr.com (FMG-7).

Reviewed-on: #1
Reviewed-by: Felipe M <me@fmartingr.com>
2026-09-09 19:53:11 +02:00

55 lines
1.5 KiB
YAML

name: "SSH Deploy"
description: "Deploy files to a remote server via SSH and rsync"
inputs:
host:
description: "SSH server address"
required: true
port:
description: "SSH port"
required: false
default: "22"
username:
description: "SSH login user"
required: true
key:
description: "Private SSH key content"
required: true
source:
description: "Local directory to deploy"
required: false
default: "."
target:
description: "Remote path on the server"
required: true
args:
description: "Extra rsync flags (e.g. --delete)"
required: false
default: ""
runs:
using: "composite"
steps:
- name: Install dependencies
shell: sh
run: |
if command -v apk > /dev/null 2>&1; then
apk add --no-cache openssh-client rsync
elif command -v apt-get > /dev/null 2>&1; then
apt-get update && apt-get install -y --no-install-recommends openssh-client rsync
else
echo "Error: unsupported package manager"
exit 1
fi
- name: Deploy
shell: sh
run: sh "${{ github.action_path }}/entrypoint.sh"
env:
INPUT_HOST: ${{ inputs.host }}
INPUT_PORT: ${{ inputs.port }}
INPUT_USERNAME: ${{ inputs.username }}
INPUT_KEY: ${{ inputs.key }}
INPUT_SOURCE: ${{ inputs.source }}
INPUT_TARGET: ${{ inputs.target }}
INPUT_ARGS: ${{ inputs.args }}
branding:
icon: "upload-cloud"
color: "blue"