Created
October 22, 2022 15:56
-
-
Save timb-machine/8c7385b478c6087bb21090e3c823cd12 to your computer and use it in GitHub Desktop.
Bulk rename my mirror repos to reference original org
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
gh repo list timb-machine-mirrors --fork -L 1230 --json name | tr "," "\n" | cut -f 4 -d "\"" | while read line | |
do | |
org=`gh repo view timb-machine-mirrors/$line --json parent | tr "," "\n" | grep login | cut -f 4 -d "\""` | |
name=`gh repo view timb-machine-mirrors/$line --json parent | tr "," "\n" | grep name | cut -f 4 -d "\""` | |
if [ "$line" != "$org-$name" ] | |
then | |
gh repo rename -y -R "timb-machine-mirrors/$line" "$org-$name" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment