Skip to content

arpansaha13/github-repo-visibility-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Repo Visibility Toggle (Go Script)

This is a lightweight Go script that lets you bulk update the visibility of your GitHub repositories, switching them between public or private, using the GitHub REST API.

It's ideal for developers who want to automate visibility changes across multiple repositories without manually editing each one.


🚀 Quick Start

1. Clone the Repo

git clone https://github.com/arpansaha13/github-repo-visibility-toggle.git

cd github-repo-visibility-toggle

2. Set Your GitHub Token

# .env

GITHUB_TOKEN=your_personal_access_token_here

3. Run the Script

go run update_visibility.go <visibility> <owner/repo> [owner/repo] ...

Example

go run update_visibility.go public username/my-repo username/another-repo

How It Works

  • Uses the GitHub REST API PATCH /repos/{owner}/{repo} endpoint.
  • Sends a JSON payload with the desired visibility.
  • Authenticates using your personal access token.

Notes

  • Valid visibility values: public or private.
  • Make sure your token has permission to edit the target repositories.

License

MIT License - Made with ❤️

About

Lightweight Go script to bulk-update repository visibility on GitHub

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages