Skip to content

fix(repo-edit): return error when changing visibility of a fork#13409

Open
wahajahmed010 wants to merge 1 commit into
cli:trunkfrom
wahajahmed010:fix/13233-fork-visibility-error
Open

fix(repo-edit): return error when changing visibility of a fork#13409
wahajahmed010 wants to merge 1 commit into
cli:trunkfrom
wahajahmed010:fix/13233-fork-visibility-error

Conversation

@wahajahmed010
Copy link
Copy Markdown

Summary

Fixes #13233.

When running gh repo edit --visibility <value> on a forked repository, GitHub silently ignores the visibility change (since forks cannot have their visibility changed independently from the parent). Previously the CLI reported success (✓ Edited repository) even though no change was made.

Changes

This PR adds validation to detect forked repositories before attempting a visibility change:

  1. Non-interactive mode (--visibility flag): Before calling the API, the code now fetches the isFork field and returns an error if the repo is a fork.

  2. Interactive mode (gh repo edit): When the user selects "Visibility" from the menu, the code now checks isFork and returns an error before presenting visibility options.

Error message: changing visibility of a forked repository is not supported

Technical Details

  • Added isFork to the list of fields retrieved when fetching repository info in interactive mode
  • Added fork detection in the non-interactive flag validation path (after the --accept-visibility-change-consequences check)
  • Added fork detection in interactiveRepoEdit() before presenting visibility options

AI-assisted fix via OpenClaw subagent

@wahajahmed010 wahajahmed010 requested a review from a team as a code owner May 12, 2026 23:48
@wahajahmed010 wahajahmed010 requested a review from BagToad May 12, 2026 23:48
@github-actions github-actions Bot added external pull request originating outside of the CLI core team needs-triage needs to be reviewed ready-for-review and removed needs-triage needs to be reviewed labels May 12, 2026
@github-actions
Copy link
Copy Markdown

Thanks for your pull request! While it doesn't meet all of our standard requirements, it appears to be a small, focused contribution and has been routed to the team for review.

Note: We still encourage linking to an issue with the help wanted label when possible, as it helps us prioritize and track contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team ready-for-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gh repo edit reports success when changing visibility of a fork but no change is made

1 participant