Merge pull request #754 from spacewander/prompt_passwd_before_2fa

git-fork: prompt for password before 2FA code.
This commit is contained in:
hemanth.hm 2019-06-03 11:06:59 +05:30 committed by GitHub
commit 1712db2146
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,6 +14,8 @@ test -z "$url" && abort "github repo needs to be specified as an argument"
echo "Enter your github username"
read user
[ -n "$user" ] || abort "git username required"
echo "Enter github password for user \"$user\""
read -s passwd
echo "Enter github two-factor authentication code (leave blank if not set up)"
read MFA_CODE
@ -33,7 +35,7 @@ fi
# create fork
curl -qsf \
-X POST \
-u "$user" \
-u "$user:$passwd" \
-H "X-GitHub-OTP: $MFA_CODE" \
"https://api.github.com/repos/$owner/$project/forks"