From 5f21de0df51d0ae4c1c9286b4bf7e4ed55e5f041 Mon Sep 17 00:00:00 2001 From: Alexey Golub <1935960+Tyrrrz@users.noreply.github.com> Date: Sat, 28 Aug 2021 10:30:58 -0700 Subject: [PATCH] Refactor webhook in CD --- .github/workflows/CD.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index c63da4d..9f6eee8 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -13,6 +13,10 @@ jobs: - name: Checkout uses: actions/checkout@v2.3.3 + - name: Get release version + id: get-version + uses: dawidd6/action-get-tag@v1 + - name: Install .NET uses: actions/setup-dotnet@v1.7.2 with: @@ -25,7 +29,15 @@ jobs: run: dotnet nuget push CliFx/bin/Release/*.nupkg -s nuget.org -k ${{ secrets.NUGET_TOKEN }} - name: Notify Discord - run: | - curl '${{ secrets.DISCORD_WEBHOOK }}' \ - --data-raw '{"content":"**CliFx** new version released!\nRef: `${{ github.ref }}`\nChangelog: "}' \ - -H 'content-type: application/json' + uses: satak/webrequest-action@v1.2.4 + with: + url: ${{ secrets.DISCORD_WEBHOOK }} + method: POST + headers: | + { + "ContentType": "application/json; charset=UTF-8" + } + payload: | + { + "content": "**CliFx** new version released!\nVersion: `${{ steps.get-version.outputs.tag }}`\nChangelog: " + }