diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 995d7b4..186d131 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,20 +43,31 @@ jobs: - name: Extract release data id: release run: | - echo "title=$(echo "${{ github.event.release.name }}" | sed 's/"/\\"/g')" >> $GITHUB_OUTPUT - echo "body=$(echo "${{ github.event.release.body }}" | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/"/\\"/g')" >> $GITHUB_OUTPUT + echo "title=${{ github.event.release.name }}" >> $GITHUB_OUTPUT + { + echo "body<> $GITHUB_OUTPUT + + - name: Install jq + run: sudo apt-get update && sudo apt-get install -y jq - name: Publish changelog to Readme env: README_API_KEY: ${{ secrets.README_API_KEY }} run: | + jq -n --arg title "Python Unified SDK ${{ steps.release.outputs.title }}" \ + --arg body "${{ steps.release.outputs.body }}" \ + '{ + title: $title, + content: { + body: $body + }, + privacy: { view: "public" } + }' > payload.json + curl --location 'https://api.readme.com/v2/changelogs' \ - --header "Authorization: Bearer $README_API_KEY" \ - --header 'Content-Type: application/json' \ - --data '{ - "body": "${{ steps.release.outputs.body }}", - "title": "Python Unified SDK ${{ steps.release.outputs.title }}", - "privacy": { - "view": "public" - } - }' + --header "Authorization: Bearer $README_API_KEY" \ + --header 'Content-Type: application/json' \ + --data @payload.json