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

@@ -72,6 +72,13 @@ runs:
BUILDER_HOST: ${{ inputs.docker_host }}
BUILDER_USER: ${{ inputs.docker_user }}
run: |
# Defensive: strip any stray CR (CRLF checkout via core.autocrlf can
# turn "root" into "root\r", which ssh rejects with
# "remote username contains invalid characters").
SSH_KEY=$(printf '%s' "${SSH_KEY}" | tr -d '\r')
BUILDER_HOST=$(printf '%s' "${BUILDER_HOST}" | tr -d '\r')
BUILDER_USER=$(printf '%s' "${BUILDER_USER}" | tr -d '\r')
mkdir -p ~/.ssh
echo "${SSH_KEY}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
@@ -161,7 +168,8 @@ runs:
run: |
ARGS=""
while IFS= read -r line; do
trimmed=$(echo "${line}" | xargs)
# strip stray CR (CRLF checkout) and surrounding whitespace
trimmed=$(printf '%s' "${line}" | tr -d '\r' | xargs)
if [ -n "${trimmed}" ]; then
ARGS="${ARGS} --build-arg ${trimmed}"
fi