Skip to content

Commit 5bea905

Browse files
fix(gh-cli): print pull request URLs (#172)
* fix(gh-cli): print pull request URLs Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bed3e0ff-d6c7-426a-8591-4c4b8e74705c * fix(gh-cli): link fork skip output Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bed3e0ff-d6c7-426a-8591-4c4b8e74705c --------- Copilot-Session: bed3e0ff-d6c7-426a-8591-4c4b8e74705c
1 parent b6d2955 commit 5bea905

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

β€Žgh-cli/merge-pull-requests-by-title.shβ€Ž

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -390,12 +390,13 @@ while IFS= read -r repo_url || [ -n "$repo_url" ]; do
390390

391391
# Process each matching PR
392392
while IFS='|' read -r pr_number pr_title pr_author pr_branch pr_head_repo; do
393-
echo " πŸ“‹ Found PR #$pr_number: $pr_title (by $pr_author)"
393+
pr_url="https://github.com/$repo/pull/$pr_number"
394+
echo " πŸ“‹ Found PR #$pr_number: $pr_title (by $pr_author) - $pr_url"
394395

395396
if [ "$bump_patch_version" = true ]; then
396397
# Skip fork-based PRs since we can't push to the head repo
397398
if [ "$pr_head_repo" != "$repo" ]; then
398-
echo " ⚠️ Skipping $repo#$pr_number - fork-based PR ($pr_head_repo), cannot push to branch"
399+
echo " ⚠️ Skipping $pr_url - fork-based PR ($pr_head_repo), cannot push to branch"
399400
((skipped_count++))
400401
continue
401402
fi
@@ -435,9 +436,9 @@ while IFS= read -r repo_url || [ -n "$repo_url" ]; do
435436
fi
436437
fi
437438
if gh pr merge "$pr_number" --repo "$repo" "${auto_merge_args[@]}"; then
438-
echo " πŸ”„ Auto-merge enabled for $repo#$pr_number"
439+
echo " πŸ”„ Auto-merge enabled for $pr_url"
439440
else
440-
echo " ⚠️ Failed to enable auto-merge for $repo#$pr_number"
441+
echo " ⚠️ Failed to enable auto-merge for $pr_url"
441442
((fail_count++))
442443
fi
443444
fi
@@ -478,7 +479,7 @@ while IFS= read -r repo_url || [ -n "$repo_url" ]; do
478479
merge_args+=("--auto")
479480
fi
480481
if [ "$dry_run" = true ]; then
481-
echo " πŸ” Would merge $repo#$pr_number with: gh pr merge $pr_number --repo $repo ${merge_args[*]}"
482+
echo " πŸ” Would merge $pr_url with: gh pr merge $pr_number --repo $repo ${merge_args[*]}"
482483
((success_count++))
483484
else
484485
# Prompt for confirmation unless --no-prompt was passed
@@ -489,20 +490,20 @@ while IFS= read -r repo_url || [ -n "$repo_url" ]; do
489490
fi
490491
read -r -p " ❓ Merge $repo#$pr_number? [y/N] " confirm < /dev/tty
491492
if [[ ! "$confirm" =~ ^[Yy]$ ]]; then
492-
echo " ⏭️ Skipped $repo#$pr_number"
493+
echo " ⏭️ Skipped $pr_url"
493494
((skipped_count++))
494495
continue
495496
fi
496497
fi
497498
if gh pr merge "$pr_number" --repo "$repo" "${merge_args[@]}"; then
498499
if [ "$enable_auto_merge" = true ]; then
499-
echo " πŸ”„ Auto-merge enabled for $repo#$pr_number"
500+
echo " πŸ”„ Auto-merge enabled for $pr_url"
500501
else
501-
echo " βœ… Successfully merged $repo#$pr_number"
502+
echo " βœ… Successfully merged $pr_url"
502503
fi
503504
((success_count++))
504505
else
505-
echo " ❌ Failed to merge $repo#$pr_number"
506+
echo " ❌ Failed to merge $pr_url"
506507
((fail_count++))
507508
fi
508509
fi

0 commit comments

Comments
Β (0)