Skip to content
New issue

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

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

Already on GitHub? # to your account

Repo undefined if origin URL don't end with .git #21

Closed
kbakk opened this issue Oct 29, 2020 · 3 comments
Closed

Repo undefined if origin URL don't end with .git #21

kbakk opened this issue Oct 29, 2020 · 3 comments

Comments

@kbakk
Copy link

kbakk commented Oct 29, 2020

Hello,

I'm using hukum 1.5.1 (latest, I can see).

When I run hukum, it outputs:

❯ hukum --version
{
  branch: 'master',
  hash: '9152b77035f1778e82912cc6849a6c2cee91be41',
  author: 'email@example.com',
  repo: undefined
}
Error: Request failed with status code 404
...
    baseURL: 'https://api.github.com/repos/undefined/actions',
...

I don't think my repo is set in any strange ways. But it's using http instead of git.

Seeing that hukum is using git remote (equivalent?) here's the output of that:

❯ git remote -v
origin  https://github.com/my-organization/my-repo (fetch)
origin  https://github.com/my-organization/my-repo (push)

It's working on a different repo (seemingly set up the same way as the first). Any idea what could be wrong?

@abskmj
Copy link
Owner

abskmj commented Oct 29, 2020

It looks for .git at the end of the remote URL. In your case, it should have been

❯ git remote -v
origin  https://github.com/my-organization/my-repo.git (fetch)
origin  https://github.com/my-organization/my-repo.git (push)

Could you please check if your other repo has it?

@kbakk
Copy link
Author

kbakk commented Oct 31, 2020

Indeed, it's missing it, and the other repo had it.

Running git remote set-url origin https://github.com/my-organization/my-repo.git and now hukum works.

@abskmj
Copy link
Owner

abskmj commented Oct 31, 2020

Thanks for confirming, I will keep the issue open for a fix as https URLs without .git are also valid.

@kbakk kbakk changed the title Repo undefined Repo undefined if origin URL don't end with .git Oct 31, 2020
@abskmj abskmj closed this as completed in 255661b Nov 1, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants