From f88e2fa4951bb73edf7bbe5a57754040a5795176 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Fri, 2 Jul 2021 18:25:56 +0300 Subject: [PATCH] Multiline solution As posted in https://trstringer.com/github-actions-multiline-strings/ by Thomas Stringer --- .github/workflows/buildAndDeploy.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index 5619099626..91545951cd 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -82,9 +82,17 @@ jobs: #r="${r//'%'/'%25'}" # Multiline escape sequences for % #r="${r//$'\n'/'%0A'}" # Multiline escape sequences for '\n' #r="${r//$'\r'/'%0D'}" # Multiline escape sequences for '\r' - echo "::set-output name=RELEASE_BODY::$r" # <--- Set environment variable - echo "--- reading from output ---" - echo "${{ steps.read_release.outputs.RELEASE_BODY }}" + + ## See https://trstringer.com/github-actions-multiline-strings/ + + echo "--- Set variable manually in github env ---" + + echo "RELEASE_BODY<> $GITHUB_ENV + echo "$r" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + echo "--- reading from where we wrote ---" + echo "${{ env.RELEASE_BODY }}" - name: Post announcement on Discord continue-on-error: true @@ -93,7 +101,7 @@ jobs: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} uses: Ilshidur/action-discord@0.3.2 with: - args: "'${{ steps.read_release.outputs.RELEASE_BODY }}'" + args: "${{ env.RELEASE_BODY }}" - name: Upload binaries to release @@ -106,6 +114,6 @@ jobs: overwrite: true file_glob: true # <--- Use environment variables that was created earlier - see https://github.com/svenstaro/upload-release-action - # Double-quotes so it will take the multiline, https://stackoverflow.com/questions/49457787 + # Single-quotes do not solve the multiline problem. body: | - '${{ steps.read_release.outputs.RELEASE_BODY }}' + ${{ env.RELEASE_BODY }}