From 6a9f799df08f2e8c415e1d0b0a316349c2ec278a Mon Sep 17 00:00:00 2001 From: Ivan Schaller Date: Wed, 16 Aug 2023 11:44:42 +0200 Subject: [PATCH] fix multiline --- .gitea/workflows/tests.yml | 6 +++--- README.md | 8 ++++---- entrypoint.sh | 8 ++++---- test.yml | 3 ++- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index e423f36..9e8ea5d 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -26,12 +26,12 @@ jobs: uses: https://git.44net.ch/actions/docker-run-action@main with: image: debian:11-slim - volumes: | + volumes: >- /tmp/:/tmp/ README.md:/README.md - options: | + options: >- -e TESTENV=${{ gitea.workspace }} -e TESTENV2=TESTENV2 - run: | + run: >- /bin/sh -c echo "test" diff --git a/README.md b/README.md index f00c1fd..7499274 100644 --- a/README.md +++ b/README.md @@ -22,12 +22,12 @@ password: ${{ secrets.DOCKER_PASSWORD }} registry: ghcr.io image: some-image:latest - volumes: | + volumes: >- ./testscript.sh:/testscript.sh /abc/def:/tmp - options: | + options: >- --user abc - run: | + run: >- /bin/bash /testscript.sh ``` @@ -67,7 +67,7 @@ _Note: The shell must be installed in the container_ with: image: docker:latest shell: bash - run: | + run: >- echo "first line" echo "second line" ``` diff --git a/entrypoint.sh b/entrypoint.sh index 2e106a1..4091673 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -10,7 +10,7 @@ env | grep -v -E "^(#|;| |PATH|SHLVL|HOSTNAME|DOCKER_*)" | awk '$1 ~ /^\w+=/' | # login to container registry if [ -n "${INPUT_USERNAME}" ]; then - printf '%s' "${INPUT_PASSWORD}" | docker login "${INPUT_REGISTRY}" -u "${INPUT_USERNAME}" --password-stdin + printf '%s' "'${INPUT_PASSWORD}'" | docker login "${INPUT_REGISTRY}" -u "${INPUT_USERNAME}" --password-stdin fi # set custom network @@ -24,19 +24,19 @@ if [ "${INPUT_MOUNT_SOCKET,,}" == "true" ]; then fi # map volumes -mapfile -t TMP_VOLUMES < <(printf '%b' "${INPUT_VOLUMES}") +mapfile -t -d ' ' TMP_VOLUMES < <(printf '%s' "${INPUT_VOLUMES}") for vol in "${TMP_VOLUMES[@]}"; do RUNTIME_OPTIONS+=(--volume "${vol}") done # get custom options -mapfile -t TMP_OPTIONS < <(printf '%b' "${INPUT_OPTIONS}") +mapfile -t -d ' ' TMP_OPTIONS < <(printf '%s' "${INPUT_OPTIONS}") for opt in "${TMP_OPTIONS[@]}"; do CUSTOM_OPTIONS+=("${opt}") done # get run command -mapfile -t TMP_RUN < <(printf '%b' "${INPUT_RUN}") +mapfile -t -d ' ' TMP_RUN < <(printf '%s' "${INPUT_RUN}") for cmd in "${TMP_RUN[@]}"; do RUN_COMMAND+=("${cmd}") done diff --git a/test.yml b/test.yml index 65cf34b..f422a1b 100644 --- a/test.yml +++ b/test.yml @@ -1,5 +1,6 @@ a: - b: | + b: >- + -e test22 test test2 test3