From 5cc8bf465f28c7d1ba9321cf7c0ebc50b032fa3a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 16 Sep 2025 16:27:23 -0400 Subject: [PATCH] chore(release): add release notes retrieval and update Discord notification * chore(release): remove Discord notifier and enhance release workflow * chore(release): enhance version tracking in release workflow * chore(release): add release notes retrieval and update Discord notification --------- Co-authored-by: Mariano Fuentes --- .github/workflows/release.yml | 42 ++++++++++++++++++++++++++++++++++- release.config.js | 10 --------- 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f3d3c3b96..406546b11 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,9 +27,49 @@ jobs: - name: Install dependencies run: bun install --frozen-lockfile + - name: Get version before release + id: version_before + run: echo "version=$(git describe --tags --abbrev=0 2>/dev/null || echo '')" >> $GITHUB_OUTPUT + - name: Release env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} HUSKY: 0 run: bun run semantic-release + + - name: Get version after release + id: version_after + if: ${{ success() }} + run: echo "version=$(git describe --tags --abbrev=0 2>/dev/null || echo '')" >> $GITHUB_OUTPUT + + - name: Get release notes + id: get_notes + if: ${{ success() && steps.version_after.outputs.version && steps.version_before.outputs.version != steps.version_after.outputs.version }} + run: | + NOTES=$(gh release view ${{ steps.version_after.outputs.version }} --json body -q .body | head -c 3900) + # Escape for JSON and handle multiline + NOTES=$(echo "$NOTES" | jq -Rs . | sed 's/^"//;s/"$//') + echo "notes<> $GITHUB_OUTPUT + echo "$NOTES" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Send Discord notification + if: ${{ success() && steps.version_after.outputs.version && steps.version_before.outputs.version != steps.version_after.outputs.version }} + continue-on-error: true + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + VERSION: ${{ steps.version_after.outputs.version }} + NOTES: ${{ steps.get_notes.outputs.notes }} + run: | + curl -X POST -H "Content-Type: application/json" \ + -d @- "$DISCORD_WEBHOOK" <