Skip to content

Commit 93c168c

Browse files
authored
Update release GHA (#4093)
1 parent 591f6cd commit 93c168c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,13 @@ jobs:
102102
echo "result=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT
103103
- name: Get release body
104104
run: |
105-
# Get the PR body to use in the GH release body
106-
gh pr list --search "$(git rev-parse HEAD)" --state merged --json number,body --jq '"This release was merged in PR #" + (.[0].number | tostring) + "\n" + (.[0].body | split("\n\n\n# Releases") | .[1])' > pr_body.tmp
105+
sha=$(git rev-parse HEAD)
106+
repo=$(gh repo view --json nameWithOwner -q .nameWithOwner)
107+
# Get the merged PR body to use in the GH release body
108+
gh api /repos/$repo/commits/$sha/pulls \
109+
--jq '(map(select(.merged_at != null)))
110+
| unique_by(.number)
111+
| "This release was merged in PR #" + (.[0].number | tostring) + "\n" + (.[0].body | split("\n\n\n# Releases") | .[1])' > pr_body.tmp
107112
- name: Create release
108113
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
109114
with:

0 commit comments

Comments
 (0)