fix: strip CRLF from inputs + add .gitattributes (eol=lf) -- fixes ssh username 'invalid characters'
Some checks failed
Test build-and-push (self-test) / Build tiny multi-arch image (push) Failing after 2s

This commit is contained in:
2026-07-13 19:39:29 -03:00
parent f55d654e72
commit fc7ed6bd15
5 changed files with 34 additions and 3 deletions

View File

@@ -74,6 +74,12 @@ runs:
SSH_HOST: ${{ inputs.ssh_host }}
SSH_PORT: ${{ inputs.ssh_port }}
run: |
# strip stray CR (CRLF checkout via core.autocrlf) so ssh never sees
# an invalid username/host like "root\r"
SSH_KEY=$(printf '%s' "${SSH_KEY}" | tr -d '\r')
SSH_HOST=$(printf '%s' "${SSH_HOST}" | tr -d '\r')
SSH_PORT=$(printf '%s' "${SSH_PORT}" | tr -d '\r')
mkdir -p ~/.ssh
echo "${SSH_KEY}" > ~/.ssh/id_deploy
chmod 600 ~/.ssh/id_deploy
@@ -97,6 +103,15 @@ runs:
OVERRIDE_IMAGE: ${{ inputs.image }}
OVERRIDE_TAG: ${{ inputs.image_tag }}
run: |
# strip stray CR (CRLF checkout via core.autocrlf)
SSH_HOST=$(printf '%s' "${SSH_HOST}" | tr -d '\r')
SSH_PORT=$(printf '%s' "${SSH_PORT}" | tr -d '\r')
SSH_USERNAME=$(printf '%s' "${SSH_USERNAME}" | tr -d '\r')
REMOTE_DIR=$(printf '%s' "${REMOTE_DIR}" | tr -d '\r')
COMPOSE_FILES=$(printf '%s' "${COMPOSE_FILES}" | tr -d '\r')
OVERRIDE_IMAGE=$(printf '%s' "${OVERRIDE_IMAGE}" | tr -d '\r')
OVERRIDE_TAG=$(printf '%s' "${OVERRIDE_TAG}" | tr -d '\r')
# Build -f flags if compose_files is provided
COMPOSE_FLAGS=""
if [ -n "${COMPOSE_FILES}" ] && [ "${COMPOSE_FILES// }" != "" ]; then