-
-
Save guseggert/b9622b794b0886d66e8fbf8f234ca709 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
from=$1 | |
to=$2 | |
while read -r issue_json; do | |
title=$(echo "$issue_json" | jq -r .title) | |
number=$(echo "$issue_json" | jq -r .number) | |
repo_name=$(basename "$from") | |
new_title="[${repo_name}] ${title}" | |
new_url=$(gh issue transfer --repo "$from" "$number" "$to") | |
new_number=$(basename "$new_url") | |
gh issue edit "$new_number" --repo "$to" --title "$new_title" | |
echo "Transferred '$title' from $from to $to: https://$to/issues/$new_number" | |
sleep 1 | |
done < <(gh issue list --repo "$from" --json number,title --jq '.[]' -s open -L 10000) |
Good idea, thanks! Added
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Should this also change the issue title, e.g. by prepending the name of the repo where this issue originated?