From df0a38c30d3acb8e7f8c1d6bb7e32be71ba77d69 Mon Sep 17 00:00:00 2001 From: Alan Ip Date: Mon, 28 Dec 2020 01:52:33 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20release=20pipeline.=20(#17?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitHub workflows' `set-output` command uses the OS's EOL character for ending the capture, which means `\n` characters must be replaced with something else. The community wisdom is `%0A`; see actions/toolkit#403. The `${{ github.repository }}` expression's `/` delimiter conflicts with the `sed` delimiter; avoid this by changing the `sed` delimiter to `#`. --- .github/workflows/releases.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 53227ce..6680691 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -27,7 +27,7 @@ jobs: echo "Parsing deployment tags..." tags=$(seq 3 | tac | xargs -i sh -c "echo $semver | cut -d . -f -{}") echo "$tags" | sed 's/\(.*\)/ - \1/' - echo "::set-output name=tags::$tags" + echo "::set-output name=tags::${tags//$'\n'/'%0A'}" distribute-images: env: @@ -50,8 +50,8 @@ jobs: - name: CI publish (semver only) run: | echo "${{ env.TAGS }}" | \ - sed 's/\(.*\)/${{ env.CI_REGISTRY }}\/${{ github.repository }}:\1/' | \ - sed 's/\(.*\)/docker tag ${{ env.SOURCE_IMAGE }} \1; docker push \1/' | \ + sed 's#\(.*\)#${{ env.CI_REGISTRY }}/${{ github.repository }}:\1#' | \ + sed 's#\(.*\)#docker tag ${{ env.SOURCE_IMAGE }} \1; docker push \1#' | \ sh - name: DockerHub login @@ -62,8 +62,8 @@ jobs: - name: DockerHub publish (semver and latest) run: | echo -e "${{ env.TAGS }}\nlatest" | \ - sed 's/\(.*\)/${{ github.repository }}:\1/' | \ - sed 's/\(.*\)/docker tag ${{ env.SOURCE_IMAGE }} \1; docker push \1/' | \ + sed 's#\(.*\)#${{ github.repository }}:\1#' | \ + sed 's#\(.*\)#docker tag ${{ env.SOURCE_IMAGE }} \1; docker push \1#' | \ sh create-release: