From caba56e8ec87322ae37a8621dd776fa2b381df88 Mon Sep 17 00:00:00 2001 From: Robbie Davis Date: Wed, 11 Aug 2021 14:12:57 -0400 Subject: [PATCH] Updating discord action (#479) * 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 --- .github/workflows/nightly-docker.yml | 2 +- .github/workflows/sonar-scan.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly-docker.yml b/.github/workflows/nightly-docker.yml index f47aace5a..9ee007941 100644 --- a/.github/workflows/nightly-docker.yml +++ b/.github/workflows/nightly-docker.yml @@ -91,4 +91,4 @@ jobs: with: webhook: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }} message: "A new nightly build v${{steps.get-version.outputs.assembly-version}} has been released for docker.\nhttps://hub.docker.com/r/kizaing/kavita/tags?page=1&ordering=last_updated" - embed: '{ "title": "{{ commit.title }}", "description": "{{ commit.description }}", "url": "{{ commit.url }}", "author": { "name": "{{ commit.author.name }} ({{ commit.author.username }})", "icon_url": "https://avatars.io/gravatar/{{ commit.author.email }}"} }' + embed: '{ "title": "${{ github.event.inputs.title }}", "description": "${{ github.event.inputs.body }}", "url": "{{ commit.url }}", "author": { "name": "{{ commit.author.name }} ({{ commit.author.username }})", "icon_url": "https://avatars.io/gravatar/{{ commit.author.email }}"} }' diff --git a/.github/workflows/sonar-scan.yml b/.github/workflows/sonar-scan.yml index 22edd72a7..e679b663c 100644 --- a/.github/workflows/sonar-scan.yml +++ b/.github/workflows/sonar-scan.yml @@ -137,6 +137,7 @@ jobs: run: | body='${{ steps.findPr.outputs.body }}' newBody="${body//$'\n'/}" + newBody="${body//$'#'/}" echo $newBody echo "::set-output name=BODY::$newBody" id: parse-body