regro / rever

Releaser of Versions
https://regro.github.io/rever-docs/
BSD 3-Clause "New" or "Revised" License
75 stars 34 forks source link

Rever requires password instead of using key #218

Open anki-code opened 4 years ago

anki-code commented 4 years ago

Hi! This is my first try to use rever.

I'm trying to avoid #216 and using ssh key instead of login and password. I've tested the key with github and it works:

git clone something from github
Enter passphrase for key '~/.ssh/id_rsa':

I deleted rever directory before try. But rever requires the login and password:

$ cat rever.xsh | grep TAG
$TAG_REMOTE = 'git@github.com:anki-code/xontrib-prompt-bar.git'
$TAG_TARGET = 'master'

$ rever check
No checks needed for tag activity
All CLI and import requirements met for push_tag activity
Initialized empty Git repository in ~/git/xontrib-prompt-bar/rever/git-have-push-perm/.git/
~/git/xontrib-prompt-bar/rever/git-have-push-perm ~/git/xontrib-prompt-bar
Switched to a new branch '__rever__'
[__rever__ (root-commit) d9dd83a] Checking rever permissions
Username for 'https://github.com': anki-code
Password for 'https://anki-code@github.com': 
fatal: Authentication failed for 'https://github.com/anki-code/xontrib-prompt-bar.git/'
# Because password auth disabled

What I'm doing wrong?

anki-code commented 4 years ago

In my case I checkout repo from https remote address then run rever to push using ssh.

I've found that you're checking remote address and ignore PUSH_TAG_REMOTE format. It's not so clean logic. The best way is to check the format and if it like git@<...>:<...>/<...>.git try to use ssh first.

The workaround: add $PUSH_TAG_PROTOCOL='ssh'.

scopatz commented 4 years ago

It seems like you were doing everything right. $TAG_REMOTE = 'git@github.com:anki-code/xontrib-prompt-bar.git' should have used SSH