From dcf43f71fad2f663f6dfe688a3a1862b670a2320 Mon Sep 17 00:00:00 2001 From: Joichiro Hayashi Date: Thu, 24 Sep 2026 23:30:17 +0900 Subject: [PATCH] ci(release): prepend release PR body to release notes --- .github/workflows/release.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6387dbf..984619d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -305,6 +305,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + pull-requests: read steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: @@ -324,10 +325,14 @@ jobs: done cp artifacts/vsix-*/*.vsix dist/ 2>/dev/null || true - # The notes come from the PRs merged since the previous tag, grouped by `.github/release.yml`; - # edit them on the release page afterwards if needed. + # The notes open with the release PR's body, followed by the PRs merged since the previous tag, + # grouped by `.github/release.yml`; edit them on the release page afterwards if needed. - name: Create GitHub Release - run: gh release create "$TAG" --verify-tag --generate-notes dist/* + run: | + gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/pulls" | + jq -r --arg ref "chore/release-${TAG#v}" '.[] | select(.merged_at != null and .head.ref == $ref) | .body // ""' \ + > "$RUNNER_TEMP/release-pr-body.md" + gh release create "$TAG" --verify-tag --notes-file "$RUNNER_TEMP/release-pr-body.md" --generate-notes dist/* env: GH_TOKEN: ${{ github.token }} TAG: ${{ needs.verify.outputs.tag }}