<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/i-had-80-public-github-repos-and-only-wanted-15-visible-so-i-automated-it-bwbbcwqm9" -->

---
title: I Had 80 Public GitHub Repos and Only Wanted 15 Visible...
description: A developer with 80 public GitHub repos wanted only 15 visible and built a GitHub Actions workflow to bulk-toggle repository visibility. The guide covers...
canonical: https://daily.dev/posts/i-had-80-public-github-repos-and-only-wanted-15-visible-so-i-automated-it-bwbbcwqm9
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: I Had 80 Public GitHub Repos and Only Wanted 15 Visible — So I Automated It | daily.dev
og:description: A developer with 80 public GitHub repos wanted only 15 visible and built a GitHub Actions workflow to bulk-toggle repository visibility. The guide covers...
og:url: https://daily.dev/posts/i-had-80-public-github-repos-and-only-wanted-15-visible-so-i-automated-it-bwbbcwqm9
og:image: https://api.daily.dev/og/posts/BWbbCWQM9.png
og:image:alt: I Had 80 Public GitHub Repos and Only Wanted 15 Visible — So I Automated It
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# I Had 80 Public GitHub Repos and Only Wanted 15 Visible — So I Automated It

**[Medium](https://daily.dev/sources/medium_js)** · 16 min read · 0 upvotes · 0 comments

## Summary

A developer with 80 public GitHub repos wanted only 15 visible and built a GitHub Actions workflow to bulk-toggle repository visibility. The guide covers creating a fine-grained Personal Access Token with Administration permissions, storing it as a GitHub Secret, and writing a workflow_dispatch-triggered YAML script that uses GitHub CLI to flip all repos from public to private (or vice versa) in one click. Common errors like missing --accept-visibility-change-consequences flag and 403 permission errors are explained, along with security best practices and ideas for extending the workflow with dry-run mode, exclude lists, and scheduled runs.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@mahreen.asama/i-had-80-public-github-repos-and-only-wanted-15-visible-so-i-automated-it-3572f6e9067a>

## Questions this post answers

### Why do I get a 403 'Resource not accessible by personal access token' error when running gh repo edit to change visibility?

This happens when the personal access token lacks the Administration permission, which is the only scope that governs repository-level settings like visibility, deletion, and transfer. Permissions like Metadata or Contents will not work even though they sound related. Fix it by regenerating the fine-grained PAT with Administration set to Read and write.

_Developers automating GitHub repo settings can find similar CLI troubleshooting write-ups on daily.dev._

### Why does gh repo edit require the --accept-visibility-change-consequences flag?

GitHub CLI requires this flag as a safety guardrail because changing a repository's visibility can have real side effects, such as breaking external links, GitHub Pages sites, or integrations that assumed the repo was public. Without the flag, the command fails intentionally rather than silently applying a change with unacknowledged consequences.

_Anyone scripting repository administration tasks can track gh CLI quirks like this via daily.dev._

### Should I use a classic or fine-grained personal access token for a GitHub Actions workflow that changes repository settings?

A fine-grained token is safer because it can be scoped to exactly one permission, such as Administration, across only the repositories you choose, whereas a classic token is all-or-nothing and can act on every repository you own. If a fine-grained token leaks, the blast radius is far smaller than with a classic token.

_Developers weighing PAT scopes for automation scripts can compare approaches on daily.dev._

## Similar posts on daily.dev

- [How GitHub used secret scanning to reach inbox zero](https://daily.dev/posts/how-github-used-secret-scanning-to-reach-inbox-zero-26vbmbpb8) · GitHub Blog · 0 upvotes · 0 comments
- [How GitHub gave every repository a durable owner](https://daily.dev/posts/how-github-gave-every-repository-a-durable-owner-a4g8vfcrg) · GitHub Blog · 0 upvotes · 0 comments
- [Authenticating git and gh-cli using GitHub Apps in GitHub Actions](https://daily.dev/posts/authenticating-git-and-gh-cli-using-github-apps-in-github-actions-t2qy5cqsm) · We Are .NET · 0 upvotes · 0 comments
- [How to make a bidirectional GitHub Repository Sync](https://daily.dev/posts/how-to-make-a-bidirectional-github-repository-sync-6flslldzx) · Faun · 2 upvotes · 0 comments

---

Tags: [#github](https://daily.dev/tags/github), [#automation](https://daily.dev/tags/automation), [#github-actions](https://daily.dev/tags/github-actions)

[View this post on daily.dev](https://daily.dev/posts/i-had-80-public-github-repos-and-only-wanted-15-visible-so-i-automated-it-bwbbcwqm9)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"I Had 80 Public GitHub Repos and Only Wanted 15 Visible — So I Automated It","url":"https://daily.dev/posts/i-had-80-public-github-repos-and-only-wanted-15-visible-so-i-automated-it-bwbbcwqm9","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/i-had-80-public-github-repos-and-only-wanted-15-visible-so-i-automated-it-bwbbcwqm9"},"datePublished":"2026-07-21T19:31:04.086Z","dateModified":"2026-09-14T08:20:14.653Z","description":"A developer with 80 public GitHub repos wanted only 15 visible and built a GitHub Actions workflow to bulk-toggle repository visibility. The guide covers...","image":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","thumbnailUrl":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/i-had-80-public-github-repos-and-only-wanted-15-visible-so-i-automated-it-bwbbcwqm9","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"github,automation,github-actions","timeRequired":"PT16M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"I Had 80 Public GitHub Repos and Only Wanted 15 Visible — So I Automated It"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/i-had-80-public-github-repos-and-only-wanted-15-visible-so-i-automated-it-bwbbcwqm9#faq","mainEntity":[{"@type":"Question","name":"Why do I get a 403 'Resource not accessible by personal access token' error when running gh repo edit to change visibility?","acceptedAnswer":{"@type":"Answer","text":"This happens when the personal access token lacks the Administration permission, which is the only scope that governs repository-level settings like visibility, deletion, and transfer. Permissions like Metadata or Contents will not work even though they sound related. Fix it by regenerating the fine-grained PAT with Administration set to Read and write. Developers automating GitHub repo settings can find similar CLI troubleshooting write-ups on daily.dev."}},{"@type":"Question","name":"Why does gh repo edit require the --accept-visibility-change-consequences flag?","acceptedAnswer":{"@type":"Answer","text":"GitHub CLI requires this flag as a safety guardrail because changing a repository's visibility can have real side effects, such as breaking external links, GitHub Pages sites, or integrations that assumed the repo was public. Without the flag, the command fails intentionally rather than silently applying a change with unacknowledged consequences. Anyone scripting repository administration tasks can track gh CLI quirks like this via daily.dev."}},{"@type":"Question","name":"Should I use a classic or fine-grained personal access token for a GitHub Actions workflow that changes repository settings?","acceptedAnswer":{"@type":"Answer","text":"A fine-grained token is safer because it can be scoped to exactly one permission, such as Administration, across only the repositories you choose, whereas a classic token is all-or-nothing and can act on every repository you own. If a fine-grained token leaks, the blast radius is far smaller than with a classic token. Developers weighing PAT scopes for automation scripts can compare approaches on daily.dev."}}]}
```

