You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given I don't have the admin role on the repository And Given I have a local repository cloned from GitHub When I run gh repo autolink create <keyPrefix> <urlTemplate> Then I see an informative error
error creating autolink: HTTP 404: Must have admin rights to Repository. (https://api.github.com/repos/{owner}/{repo}/autolinks)
Given I have the admin role on the repository And Given I have a local repository cloned from GitHub When I run gh repo autolink create <keyPrefix> <urlTemplate> Then I see an informational message confirming the repository autolink was created
✓ Autolink "<keyPrefix>" created in<owner>/<repo>
Given I have the admin role on the repository And Given I have a remote repository When I run gh repo autolink create <keyPrefix> <urlTemplate> --repo <owner>/<repo> Then I see an informational message confirming the repository autolink was created the same as when I have a local repository
Given I have the admin role on the repository And Given I have a local repository cloned from GitHub When I run gh repo autolink create <keyPrefix> <urlTemplate> And When<urlTemplate> does not contain literal <num> Then I see an informative error explaining <urlTemplate> must contain <num>
This issue is to implement the command necessary to create repository autolinks as discussed within #9420 underneath
gh repo autolink.This should follow similar form as existing GitHub CLI commands as well as necessary tests.
cc: @hoffm @nitrocode
Acceptance Criteria
Note
Successful commands should return
0exit code whereas errors should return1unless otherwise stated.When I run
gh repo autolink create --helpThen I see an informative help usage containing descriptive command information:
Long description explaining command purpose
Usage:
gh repo autolink create <keyPrefix> <urlTemplate> [flags]Aliases:
createcommands typically allownewaliasFlags:
Inherited flags:
INHERITED FLAGS --help Show help for command -R, --repo [HOST/]OWNER/REPO Select another repository using the [HOST/]OWNER/REPO formatExamples
Given I don't have the
adminrole on the repositoryAnd Given I have a local repository cloned from GitHub
When I run
gh repo autolink create <keyPrefix> <urlTemplate>Then I see an informative error
error creating autolink: HTTP 404: Must have admin rights to Repository. (https://api.github.com/repos/{owner}/{repo}/autolinks)Given I have the
adminrole on the repositoryAnd Given I have a local repository cloned from GitHub
When I run
gh repo autolink create <keyPrefix> <urlTemplate>Then I see an informational message confirming the repository autolink was created
Given I have the
adminrole on the repositoryAnd Given I have a remote repository
When I run
gh repo autolink create <keyPrefix> <urlTemplate> --repo <owner>/<repo>Then I see an informational message confirming the repository autolink was created the same as when I have a local repository
Given I have the
adminrole on the repositoryAnd Given I have a local repository cloned from GitHub
When I run
gh repo autolink create <keyPrefix> <urlTemplate>And When
<urlTemplate>does not contain literal<num>Then I see an informative error explaining
<urlTemplate>must contain<num>