Skip to content

Add confirmation flag to gh repo edit --visibility command #9807

@jtmcg

Description

@jtmcg

Describe the feature or problem you’d like to solve

Changing the visibility of a repository is one of the most impactful, potentially dangerous actions because of the consequences when going from public to private or internal or vice versa:

  • If you decide to make this repository public in the future, it will not be possible to restore these stars and watchers and this will affect its repository rankings.
  • Dependency graph and Dependabot alerts will remain enabled with permission to perform read-only analysis on this repository. Any custom Dependabot alert rules will be disabled unless GitHub Advanced Security is enabled for this repository.
  • Code scanning will become unavailable.
  • Current forks will remain public and will be detached from this repository.

Screenshot of GitHub repository settings danger zone
Screenshot of GitHub repository visibility changing from private to public

Users are interactively prompted when using gh repo edit command to change visibility, however there are no safeguards when used non-interactively:

➜ gh repo edit
? What do you want to edit? Visibility
? Visibility private
! Changing the repository visibility to private will cause permanent loss of stars and watchers.
? Do you want to change visibility to private? (y/N)

This issue is to implement an experience similar to various gh <primitive> delete commands requiring a boolean flag to confirm changing visibility when used non-interactively.

Acceptance Criteria

  • When gh repo edit --visibility is called non-interactively, it requires the --accept-visibility-change-consequences flag to be included or the command fails

Metadata

Metadata

Assignees

Labels

enhancementa request to improve CLIgh-reporelating to the gh repo command

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions