@kyanny's blog

My thoughts, my life. Views/opinions are my own.

gh: Must have admin rights to Repository. (HTTP 403)

This error happens if the OAuth token that gh command uses doesn't have enough scope.

According to the document, in default, gh auth login grants minimum scopes that are "repo" and "read:org".

You can add more scopes by -s option. For example, if you want to let gh command delete repository, you can reauthenticate gh command by

gh auth login -s delete_repo

See also: gh auth login | GitHub CLI