Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

semantic-release-cli setup could not get repository url #388

Open
deployn opened this issue Aug 20, 2023 · 1 comment
Open

semantic-release-cli setup could not get repository url #388

deployn opened this issue Aug 20, 2023 · 1 comment

Comments

@deployn
Copy link

deployn commented Aug 20, 2023

I encountered an error while running the command $ npx semantic-release-cli setup on my project. During the process, I received the following error message: ERR! semantic-release Could not get repository url. Please create/add the repository. even while having a remote repository set up. After investigating further, I realized that the issue was related to the remote repository not being named ‘origin’.

Renaming the remote to ‘origin’ resolved the problem for me.

However, it would be beneficial if the semantic-release-cli tool could analyze other remotes as well, or if the error message could provide more specific information about the cause of the issue such as ERR! semantic-release Could not get repository URL. Please create/add the repository as the remote named ‘origin’.

@seebeen
Copy link
Member

seebeen commented Aug 20, 2023

Yes, you are correct. The CLI package automatically looks for origin remote.

const repo = gitConfig['remote "origin"'].url;

Naming the primary remote in Git as "origin" is a widely followed convention. When you clone a repository from a remote server, Git automatically names it "origin" for you. This helps keep consistency across different projects.

The "origin" name is so widely used that many developers will automatically understand what it refers to, so I don't believe that this will be changed because it's so ubiquitous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants