Require repository name for visibility changes#13505
Conversation
|
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 |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR changes the interactive repo edit flow to require typing the full OWNER/REPO name to confirm visibility changes, instead of a simple yes/no confirmation prompt.
Changes:
- Replaced visibility-change confirmation from
Confirm()toInput()with repo full-name matching. - Updated interactive tests to reflect the new typed-confirmation behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/cmd/repo/edit/edit.go | Implements typed OWNER/REPO confirmation before applying a visibility change. |
| pkg/cmd/repo/edit/edit_test.go | Updates interactive tests to validate matching vs non-matching typed confirmation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return err | ||
| } | ||
| if confirmed { | ||
| if confirmedRepository == repoFullName { |
| } | ||
| if confirmed { | ||
| if confirmedRepository == repoFullName { | ||
| opts.Edits.Visibility = &selectedVisibility |
Fixes #13435
Summary
This updates the interactive
gh repo editvisibility flow to require typing the fullOWNER/REPOrepository name before applying a visibility change, instead of accepting a yes/no confirmation.The non-interactive
--accept-visibility-change-consequencesbehavior is unchanged.Motivation
Changing a public repository to private can have lasting consequences for stars, watchers, forks, and repository network state. A recent Hexo incident showed how easy it is to run
gh repo editfrom the wrong local checkout and only notice the repository name after the change has already happened: hexojs/site#2534Requiring the full repository name makes the interactive CLI flow closer to the safer confirmation pattern used by repository deletion and GitHub.com.
Testing
go test ./pkg/cmd/repo/edit