From 94d36dc9cd8f83800a21cf3100c284b4ae963dab Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Wed, 10 Aug 2022 13:09:44 +0200 Subject: [PATCH] Fix multiline output --- .github/workflows/pr_diff.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr_diff.yaml b/.github/workflows/pr_diff.yaml index 2a49ba2..d44fd93 100644 --- a/.github/workflows/pr_diff.yaml +++ b/.github/workflows/pr_diff.yaml @@ -8,7 +8,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: azure/setup-helm@v3 - - id: diff + - name: Run diff + id: diff run: | alias helm_test_template='helm template --debug \ --set serviceAccount.create=true \ @@ -26,12 +27,15 @@ jobs: --set s3.region=us-42 / --set s3.bucket=abc / --set s3.encrypt=abc' - OUTPUT="$(diff -u <(helm_test_template ${{ github.server_url }}/${{ github.repository }}/archive/refs/heads/${{ github.base_ref }}.tar.gz) <(helm_test_template .))" - echo "::set-output name=result::$OUTPUT" + # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings + echo 'HELM_DIFF<> $GITHUB_ENV + diff -u <(helm_test_template ${{ github.server_url }}/${{ github.repository }}/archive/refs/heads/${{ github.base_ref }}.tar.gz) <(helm_test_template .) >> $GITHUB_ENV + echo 'EOF' >> $GITHUB_ENV - uses: marocchino/sticky-pull-request-comment@v2 with: message: | - This PR results in the following smoketest diff: + Running a `helm template` smoketest on this branch results in the following diff against `${{ github.base_ref }}`: + ```diff - ${{ steps.diff.outputs.result }} + ${{ env.HELM_DIFF }} ```