This file contains hidden or 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 | |
| # Replace this with your GitHub username | |
| USERNAME="<your-username>" | |
| # Visibility: private | public | internal | |
| VISIBILITY="private" | |
| for repo in $(gh repo list $USERNAME --limit 100 --json name --jq '.[].name') | |
| do |
This file contains hidden or 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
| repos=$(gh repo list [your_username] --visibility private --json nameWithOwner -q '.[].nameWithOwner') | |
| for repo in $repos | |
| do | |
| gh api -X PATCH repos/$repo -f visibility=public | |
| echo "Visibility of $repo changed to public" | |
| done |