Created
November 12, 2022 15:53
-
-
Save joshjohanning/e7ae1abfefd74d7f9e5f915d42929d47 to your computer and use it in GitHub Desktop.
Update the repo visibility for all repos in a github org from internal to private
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
ORG_NAME="joshjohanning-org" | |
# get a list of internal repos in my github org | |
repos=$(gh api "/orgs/$ORG_NAME/repos" -q '.[] | select(.visibility == "internal") | .name' --paginate) | |
# loop through repos | |
for repo in $repos; do | |
echo "Changing visiblity to internal: $ORG_NAME/$repo" | |
echo "Changing visiblity to internal: $ORG_NAME/$repo" >> change-repo-visiblity.log | |
gh repo edit $ORG_NAME/$repo --visibility private | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment