GitHub CLI 2.104.0
新功能 1 項
01
刪除私有或內部儲存庫前會再確認 fork
清理不再維護的 GitHub 儲存庫,不少人習慣在 gh repo delete 後面補上 --yes 直接跳過確認。現在要刪的如果是私有或內部儲存庫,而且會一併刪掉底下的 fork(從原儲存庫另外複製出去的獨立副本),指令就會先跳出警告。這時你得再確認一次,就算已經加上 --yes 也一樣。
如果是沒有人手輸入的非互動式流程或代理程式,執行刪除就必須明確加上同意連帶刪除的參數:
```shell gh repo delete OWNER/REPO --yes --accept-cascading-deletion-of-private-forks ```
打個比方
就像管理員要關掉大樓的總電源,以前只要拿到授權單就直接斷電,現在發現線路還接著其他人的設備,就會先暫停並要求再確認,連自動排程也得另外寫明同意一併斷電。
官方原文
## Protect private forks when deleting repositories
gh repo delete now warns when deleting a private or internal repository will also delete its forks. The additional confirmation is required even with --yes.
Non-interactive workflows and agents must explicitly accept the cascading deletion:
```shell
gh repo delete OWNER/REPO --yes --accept-cascading-deletion-of-private-forks
```