Typos in dev-repo produces some surprising behaviour
$ dune-release
[...]
[-] Publishing to github
Username for 'https://github.com': kit-ty-kate
Password for 'https://[email protected]':
dune-release: [ERROR] Exit code 128 from command
`git --git-dir .git ls-remote --quiet --tags
https://github.com/kit-ty-kate/opam-docker-hub.git v0.1.0`:
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/kit-ty-kate/opam-docker-hub.git/'
$ ls ~/.config/dune/
github.token release.yml
$ cat ~/.config/dune/release.yml
remote: [email protected]:kit-ty-kate/opam-repository.git
local: /Users/kit_ty_kate/.config/dune/opam-repository
$ git remote show origin
* remote origin
Fetch URL: [email protected]:kit-ty-kate/ocaml-docker-hub.git
Push URL: [email protected]:kit-ty-kate/ocaml-docker-hub.git
[...]
Is the repo private? This looks like it is hence the reason why you're asked a password for ls-remote. I think atm it's safe to say dune-release does not support private repos release.
If the repo is public it's a different matter but I'm a bit suprised then. You shouldn't need to authenticate to ls-remote on a public repo.
It is a public repository: https://github.com/kit-ty-kate/ocaml-docker-hub/
This is extremely strange, I'm able to run ls-remote on other repos, using https, without any auth but not on this particular one.
Hmm this is even weirder, I'm reruning the command locally and now it works, after having failed earlier.
Haha got it! The command being run by dune-release is:
git ls-remote https://github.com/kit-ty-kate/opam-docker-hub.git
The repo you linked above is ocaml-docker-hub, not opam-docker-hub. Might it be a typo somewhere in an opam file dev-repo or homepage field?
The problem here is that Github, in order to prevent malicious users to guess existing private repos name ask for auth whenever you try to access a repo URL that isn't a public repo, be it a private one or a non existing one. That's why you're getting asked for your username and password.
We could try to properly wrap the ls-remote invocation to detect those errors and report with the actual problem though!