From 657f4cd8de59288799e43942edd128be9b3f1b00 Mon Sep 17 00:00:00 2001 From: gabemeola <14303404+gabemeola@users.noreply.github.com> Date: Wed, 1 Jul 2026 15:12:53 +0000 Subject: [PATCH] feat: include formatted changelog in release bump PR body --- scripts/bump-version.sh | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh index 9223d93..0271d61 100755 --- a/scripts/bump-version.sh +++ b/scripts/bump-version.sh @@ -8,6 +8,7 @@ VERSION="${1:?usage: bump-version.sh }" VERSION="${VERSION#v}" BRANCH="pr/opencode-release/v${VERSION}" TARGET="${2:-main}" +UPSTREAM_REPO="anomalyco/opencode" log() { echo "[bump] $*"; } die() { echo "[bump] error: $*" >&2; exit 1; } @@ -18,9 +19,31 @@ pr_exists() { gh pr list --state open --head "$BRANCH" --json url -q '.[].url' 2>/dev/null | grep -q . } +fetch_changelog() { + gh api "repos/${UPSTREAM_REPO}/releases/tags/v${VERSION}" --jq '.body' 2>/dev/null || true +} + +pr_body() { + local changelog="$1" + cat < This PR was created automatically by a scheduled workflow. +EOB +} + create_pr() { local title="feat: opencode release v${VERSION}" - local body="Automatic version bump for opencode ${VERSION}.\n\nChangelog:\nhttps://github.com/anomalyco/opencode/releases/tag/v${VERSION}\n\n> This PR was created automatically by a scheduled workflow." + local changelog + changelog="$(fetch_changelog)" + local body + body="$(pr_body "$changelog")" gh pr create \ --title "$title" \ @@ -30,7 +53,10 @@ create_pr() { update_pr() { local title="feat: opencode release v${VERSION}" - local body="Automatic version bump for opencode ${VERSION}.\n\nChangelog:\nhttps://github.com/anomalyco/opencode/releases/tag/v${VERSION}\n\n> This PR was created automatically by a scheduled workflow." + local changelog + changelog="$(fetch_changelog)" + local body + body="$(pr_body "$changelog")" gh pr edit \ --title "$title" \