From fb49d824fbefed39350913deaa581e3d660f9e8e Mon Sep 17 00:00:00 2001 From: Damian Mee Date: Sun, 15 Mar 2020 20:34:14 +0800 Subject: [PATCH] =?UTF-8?q?Another=20take=20on=20sed=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0a3a880..39a1ee2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.11 -RUN apk add --no-cache sed file curl jq +RUN apk add --no-cache file curl jq COPY entrypoint.sh / diff --git a/entrypoint.sh b/entrypoint.sh index 375c69a..851ac65 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -115,7 +115,7 @@ status_code="$(jq -nc \ --argjson target_commitish "$(toJsonOrNull "$INPUT_COMMITISH")" \ --argjson name "$(toJsonOrNull "$INPUT_NAME")" \ --argjson prerelease "$(toJsonOrNull "$INPUT_PRERELEASE")" \ - --argjson body "$(toJsonOrNull "$(echo "$INPUT_BODY" | sed -z 's/\n/\\n/g')")" \ + --argjson body "$(toJsonOrNull "$(echo "$INPUT_BODY" | sed ':a;N;$!ba;s/\n/\\n/g')")" \ '{$tag_name, $target_commitish, $name, $body, $draft, $prerelease} | del(.[] | nulls)' | \ curl -s -X "$method" -d @- \ --write-out "%{http_code}" -o "/tmp/$method.json" \