# Create a repository with a file so it has a default branch
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private

# List the repos and check for the new repo
exec gh repo list $ORG --json=name --jq='.[].name'
stdout $SCRIPT_NAME-$RANDOM_STRING

# Rename the repo
exec gh repo rename $SCRIPT_NAME-$RANDOM_STRING-renamed --repo=$ORG/$SCRIPT_NAME-$RANDOM_STRING --yes

# Defer repo deletion
defer gh repo delete $ORG/$SCRIPT_NAME-$RANDOM_STRING-renamed --yes

# List the repos and check for the renamed repo
exec gh repo list $ORG --json=name --jq='.[].name'
stdout $SCRIPT_NAME-$RANDOM_STRING-renamed
