Compare commits

...
3 changed files with 60 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
Please use the scripts/git-list-prs-since-last-release.sh script to get a list of the PRs included in main on this repo since the last release, and dig deeper into each PR to understand the changes more deeply so that we can generate a concise set of changelog entries for the important changes that need to be surfaced while ignoring smaller changes that would simply be noise in the summarized changelog. Come up with the complete summary changelog that I can use for this next upcoming release. The final summary should consist of simple bullet points that are relevant to human readers and should be collated under the headers "Added", "Fixed", and "Changed"; it should simply list the things that are relevant to know and no more than that. If there are two or more entries that should be combined into a single bullet point, please do so (for example if a general statement spanning two or three bullet points would be a more concise and still highly relevant way of grouping them).
+29
View File
@@ -0,0 +1,29 @@
# Script for creating changelog list based on all PRs merged into the current repo since the last release tag.
# Auto-detects the latest vX.Y.Z tag.
# 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 owner and name from remote
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
OWNER=$(echo "$REPO" | cut -d/ -f1)
NAME=$(echo "$REPO" | cut -d/ -f2)
# Build query body and execute in single request
QUERY_BODY=$(git log --first-parent --pretty=%s "$TAG..main" |
grep -Eo '#[0-9]+' |
tr -d '#' |
sort -un |
awk '{printf "pr%s: pullRequest(number: %s) { number title url } ", $1, $1}')
gh api graphql \
-f query="query { repository(owner: \"$OWNER\", name: \"$NAME\") { $QUERY_BODY }}" 2>/dev/null |
jq -r '.data.repository | to_entries | sort_by(.value.number // 999999) | .[] | select(.value != null) | "- #\(.value.number) \(.value.title | gsub("[\\r\\n]+"; " ") | gsub("\\s+"; " ") | ltrimstr(" ") | rtrimstr(" ")) (\(.value.url))"' |
grep -v '^$'
+30
View File
@@ -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