From ab9c40ddc68de3fd4d26d42fbe58a4dd64dc92be Mon Sep 17 00:00:00 2001 From: Robbie Davis Date: Thu, 12 Aug 2021 11:51:17 -0400 Subject: [PATCH] Update discord action (#486) * Updating docker action * adding version to message * adding way to get PR title and body * Adding input pass to workflows Workflow dispatches may not get push header info. Switching logic to pass needed title and body info through just in case. * adding token The description on this action is awful, it didn't mention needing a token. I found this solution from the repo's issues * parsing pr body * Updating parsing * Updating docker workflow * Reverting back to default variables * fixing syntax error * removing heading syntax * updating parse * Updating parsing * Updating docker workflow * trying to remove newline --- .github/workflows/nightly-docker.yml | 2 +- .github/workflows/sonar-scan.yml | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nightly-docker.yml b/.github/workflows/nightly-docker.yml index 0f95013c4..9f57c8974 100644 --- a/.github/workflows/nightly-docker.yml +++ b/.github/workflows/nightly-docker.yml @@ -90,7 +90,7 @@ jobs: uses: rjstone/discord-webhook-notify@v1 with: severity: info - description: ${{steps.get-version.outputs.assembly-version}} + description: v${{steps.get-version.outputs.assembly-version}} details: '${{ github.event.inputs.body }}' text: A new nightly build has been released for docker. webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }} diff --git a/.github/workflows/sonar-scan.yml b/.github/workflows/sonar-scan.yml index a90ad0746..0afdc4278 100644 --- a/.github/workflows/sonar-scan.yml +++ b/.github/workflows/sonar-scan.yml @@ -136,10 +136,9 @@ jobs: - name: Parse PR body run: | body='${{ steps.findPr.outputs.body }}' - newBody="${body//$'\n'/}" - newB="${newBody//$'#'/}" - echo $newB - echo "::set-output name=BODY::$newB" + newBody=$(echo $body | sed ':a;N;$!ba;s/\n/ /g') + echo $newBody + echo "::set-output name=BODY::$newBody" id: parse-body - name: If Push to Develop, Trigger Docker Stable