Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions scripts/backport_to_staging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,13 @@ echo "Dry Run: ${DRY_RUN:-0}"
echo "Continue Mode: $CONTINUE_MODE"
echo ""

# Set a default git identity as fallback (in case PR author detection fails)
git config user.name "AztecBot"
git config user.email "tech@aztec-labs.com"

# Get PR information
echo "Fetching PR information..."
if ! PR_INFO=$(gh pr view "$PR_NUMBER" --json number,title,state,mergedAt,body,author 2>&1); then
if ! PR_INFO=$(gh pr view "$PR_NUMBER" --json number,title,state,mergedAt,body,author); then
echo "Error: Failed to fetch PR #$PR_NUMBER" >&2
exit 1
fi
Expand All @@ -91,8 +95,14 @@ PR_TITLE=$(echo "$PR_INFO" | jq -r '.title')
PR_STATE=$(echo "$PR_INFO" | jq -r '.state')
PR_BODY=$(echo "$PR_INFO" | jq -r '.body')
PR_MERGED_AT=$(echo "$PR_INFO" | jq -r '.mergedAt')
PR_AUTHOR=$(echo "$PR_INFO" | jq -r '.author.login')
PR_AUTHOR_EMAIL="${PR_AUTHOR}@users.noreply.github.com"
PR_AUTHOR=$(echo "$PR_INFO" | jq -r '.author.login // empty')
if [[ -n "$PR_AUTHOR" && "$PR_AUTHOR" != "null" ]]; then
PR_AUTHOR_EMAIL="${PR_AUTHOR}@users.noreply.github.com"
else
echo "Warning: Could not determine PR author, using AztecBot as fallback" >&2
PR_AUTHOR="AztecBot"
PR_AUTHOR_EMAIL="tech@aztec-labs.com"
fi

echo "PR Title: $PR_TITLE"
echo "PR State: $PR_STATE"
Expand Down
Loading