Some checks failed
Deploy analytics worker / Deploy analytics worker to ${{ (github.ref == 'refs/heads/production' && 'production') || (github.ref == 'refs/heads/main' && 'staging') || 'preview' }} (push) Failing after 1s
i18n upload strings / Upload latest strings (push) Failing after 1s
Deploy bemo / Deploy bemo to ${{ (github.ref == 'refs/heads/bemo-production' && 'production') || (github.ref == 'refs/heads/main' && 'staging') || 'preview' }} (push) Failing after 1s
Deploy grafana resources / ${{ github.event_name == 'push' && 'Deploy grafana resources' || 'Validate grafana resources (dry run)' }} (push) Failing after 0s
End to end tests (dotcom) / Check for relevant changes (push) Failing after 0s
End to end tests (examples) / Check for relevant changes (push) Failing after 0s
End to end tests (mermaid readability) / Check for relevant changes (push) Failing after 1s
End to end tests (perf) / Check for relevant changes (push) Failing after 0s
Publish editor extensions / Publish editor extensions (push) Failing after 1s
Publish SDK packages / Remove the publish-packages label (push) Has been skipped
Checks / Tests & checks (push) Has been cancelled
Checks / Build all projects (push) Has been cancelled
Deploy templates / Deploy templates (push) Has been cancelled
End to end tests (dotcom) / End to end tests (dotcom) (push) Has been cancelled
End to end tests (mermaid readability) / End to end tests (mermaid readability) (push) Has been cancelled
End to end tests (perf) / End to end tests (perf) (push) Has been cancelled
Deploy .com / Deploy dotcom to ${{ (github.ref == 'refs/heads/production' && 'production') || (github.ref == 'refs/heads/main' && 'staging') || 'preview' }} (push) Has been cancelled
End to end tests (examples) / End to end tests (examples) (push) Has been cancelled
Publish SDK packages / Publish SDK packages (push) Has been cancelled
Publish SDK packages / Tell user released version (push) Has been cancelled
Publish SDK packages / Publishes code templates to separate repositories (push) Has been cancelled
Publish SDK packages / Deploys the template demos with the new SDK version (push) Has been cancelled
89 lines
2.4 KiB
Bash
Executable File
89 lines
2.4 KiB
Bash
Executable File
#!/bin/bash
|
|
# Find PR numbers on the main branch since a release tag.
|
|
# Uses `git cherry` to compare patches between origin/main and the
|
|
# release tag, excluding commits that were cherry-picked to production
|
|
# and already shipped in the release.
|
|
#
|
|
# Usage: ./get-new-prs-from-main.sh <tldraw-repo-dir> <release-tag>
|
|
# Example: ./get-new-prs-from-main.sh /tmp/tldraw v4.4.0
|
|
#
|
|
# Output:
|
|
# PR numbers (one per line) on stdout, then any commits
|
|
# without PR numbers (hash + title) on stderr.
|
|
#
|
|
# Requires a local clone of tldraw/tldraw.
|
|
|
|
set -e
|
|
|
|
if [ -z "$1" ] || [ -z "$2" ]; then
|
|
echo "Usage: $0 <tldraw-repo-dir> <release-tag>" >&2
|
|
echo "Example: $0 /tmp/tldraw v4.4.0" >&2
|
|
exit 1
|
|
fi
|
|
|
|
TLDRAW_REPO="$1"
|
|
RELEASE_TAG="$2"
|
|
|
|
cd "$TLDRAW_REPO"
|
|
|
|
# Fetch to ensure we have latest refs
|
|
git fetch origin main --quiet 2>/dev/null || true
|
|
|
|
# Verify the tag exists
|
|
if ! git rev-parse "$RELEASE_TAG" >/dev/null 2>&1; then
|
|
echo "Error: tag '$RELEASE_TAG' not found" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# The release tag lives on the production branch, which has a separate
|
|
# history from main (deploy commits, hotfixes, version bumps). Many
|
|
# commits on main after the branch point were cherry-picked to production
|
|
# and shipped in the release. We use `git cherry` to compare patches and
|
|
# exclude commits that are already in the release — just like
|
|
# get-new-prs.sh does for production.
|
|
#
|
|
# `git cherry <release-tag> origin/main` marks commits unique to main
|
|
# with '+' and those already in the release with '-'.
|
|
commit_hashes=$(git cherry "$RELEASE_TAG" origin/main 2>/dev/null \
|
|
| grep '^+' \
|
|
| cut -d' ' -f2)
|
|
|
|
pr_numbers=()
|
|
unmatched=()
|
|
|
|
for hash in $commit_hashes; do
|
|
# Get the first line of the commit message
|
|
title=$(git log -1 --pretty=format:%s "$hash" 2>/dev/null)
|
|
|
|
# Skip [skip ci] commits (version bumps, deploys)
|
|
if echo "$title" | grep -q '\[skip ci\]'; then
|
|
continue
|
|
fi
|
|
|
|
# Skip deploy commits
|
|
if echo "$title" | grep -q '^Deploy from'; then
|
|
continue
|
|
fi
|
|
|
|
# Extract PR number from commit message (format: "... (#1234)")
|
|
pr=$(echo "$title" | grep -oE '#[0-9]+' | head -1 | sed 's/#//')
|
|
|
|
if [ -n "$pr" ]; then
|
|
pr_numbers+=("$pr")
|
|
else
|
|
unmatched+=("$hash $title")
|
|
fi
|
|
done
|
|
|
|
# Output unique PR numbers, sorted descending
|
|
printf '%s\n' "${pr_numbers[@]}" | sort -rn | uniq
|
|
|
|
# Output unmatched commits to stderr
|
|
if [ ${#unmatched[@]} -gt 0 ]; then
|
|
echo "" >&2
|
|
echo "Commits without PR numbers:" >&2
|
|
for line in "${unmatched[@]}"; do
|
|
echo " $line" >&2
|
|
done
|
|
fi
|