@@ -31,24 +31,22 @@ jobs:
3131 TAG_NAME="v$(echo "$PR_TITLE" | awk '{print $2}')"
3232 git tag "$TAG_NAME"
3333 git push origin "$TAG_NAME"
34-
35- - name : Generate Release Notes
36- id : generate-release-notes
34+
35+ - name : Get PR body from release PR for release notes
36+ id : get-pr-body
3737 run : |
38- TAG_NAME="v$(echo "$PR_TITLE" | awk '{print $2}')"
39- response=$(curl -s -X POST \
40- -H "Accept: application/vnd.github+json" \
41- -H "Authorization: Bearer $GITHUB_TOKEN" \
42- https://api.github.com/repos/${{ github.repository }}/releases/generate-notes \
43- -d "$(jq -n --arg tag_name "$TAG_NAME" \
44- --arg target_commitish "main" \
45- '{tag_name: $tag_name, target_commitish: $target_commitish}')")
46- echo "$response" | jq -r '.body' > release_notes.txt
38+ echo "Fetching PR body for release notes..."
39+ PR_RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
40+ -H "Accept: application/vnd.github.v3+json" \
41+ https://api.github.com/repos/${{ github.repository_owner }}/${{ github.event.repository.name }}/pulls/${{ github.event.pull_request.number }})
42+
43+ PR_BODY=$(echo "$PR_RESPONSE" | jq -r '.body')
44+ echo "$PR_BODY" > pr_release_notes.txt
4745
4846 - name : Create GitHub Release
4947 run : |
5048 TAG_NAME="v$(echo "$PR_TITLE" | awk '{print $2}')"
51- RELEASE_NOTES=$(cat release_notes .txt)
49+ RELEASE_NOTES=$(cat pr_release_notes .txt)
5250 curl -X POST \
5351 -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
5452 -H "Accept: application/vnd.github.v3+json" \
0 commit comments