From 4b3544df92fa27bc2c067c09c6771b85cc5f9a4a Mon Sep 17 00:00:00 2001 From: cline-test <132302818+candieduniverse@users.noreply.github.com> Date: Thu, 29 Jan 2026 15:08:14 -0800 Subject: [PATCH] feat(release-eng): Add script for listing PRs since last release. --- scripts/git-list-prs-since-last-release.sh | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 scripts/git-list-prs-since-last-release.sh diff --git a/scripts/git-list-prs-since-last-release.sh b/scripts/git-list-prs-since-last-release.sh new file mode 100755 index 0000000000..b840446128 --- /dev/null +++ b/scripts/git-list-prs-since-last-release.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Script for creating changelog list based on all PRs merged since the last release tag. +# Uses only git - no GitHub CLI required. + +# Get the most recent version tag (sorted by semantic version) +TAG=$(git tag --list 'v[0-9]*' --sort=-version:refname | head -1) + +if [ -z "$TAG" ]; then + echo "Error: No version tags found matching v* pattern" >&2 + exit 1 +fi + +echo "Generating changelog since $TAG..." + +# Get repo URL from git remote (handles both SSH and HTTPS formats) +REPO_URL=$(git remote get-url origin | sed -E 's|git@github.com:|https://github.com/|' | sed 's|\.git$||') + +# Extract PR info from merge commit messages and format as changelog entries +git log --first-parent --pretty=format:"%s" "$TAG..main" | + grep -oE '.+ \(#[0-9]+\)$' | + while IFS= read -r line; do + pr=$(echo "$line" | grep -oE '#[0-9]+\)$' | tr -d '#)') + title=$(echo "$line" | sed -E 's| \(#[0-9]+\)$||') + echo "$pr|$title" + done | + sort -t'|' -k1 -n -u | + while IFS='|' read -r pr title; do + echo "- #$pr $title ($REPO_URL/pull/$pr)" + done +