-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions welcomeContributions welcomepriority-3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic
Description
Describe the bug
When attempting to gh repo create with a license that doesn't exist, the error message is wrong/misleading.
gh version 2.2.0 (2021-10-25)
https://github.com/cli/cli/releases/tag/v2.2.0
Steps to reproduce the behavior
gh repo create --public -l cc-by org/name-of-repo
? Would you like to add a .gitignore? Yes
? Choose a .gitignore template R
? This will create the "org/name-of-repo" repository on GitHub. Continue? Yes
HTTP 422: Repository creation failed. (https://api.github.com/orgs/org/repos)
license_template is an unknown license template.
This API operation needs the "public_repo" scope. To request it, run: gh auth refresh -h github.com -s public_repo
Expected vs actual behavior
Expected: error message that says "cc-by is not a known license template. Please see https://fancy/place/url for allowed tags".
Actual: The error repeats. The gh app has already been granted "public_repo" scope, so that error message is misleading. Omitting the license flags (without going through the suggested auth step) yields the suggested result (repo gets created) without a license.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions welcomeContributions welcomepriority-3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic