mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
PR test
This commit is contained in:
parent
2f3772b09a
commit
2dc9c26e36
|
|
@ -38,6 +38,18 @@ fi
|
|||
|
||||
test -z "$user" && abort "git config user.email required"
|
||||
|
||||
# personal access token
|
||||
|
||||
personal_access_token=$(git config git-extras.personal-access-token)
|
||||
|
||||
# if [ -z "$personal_access_token" ]
|
||||
# then
|
||||
# personal_access_token="master"
|
||||
# fi
|
||||
|
||||
echo "My Personal Access Token Is : " $personal_access_token
|
||||
test -z "$personal_access_token" && abort "git config git-extras.personal_access_token required"
|
||||
|
||||
# branch
|
||||
|
||||
branch=${1-$(git symbolic-ref HEAD | sed 's/refs\/heads\///')}
|
||||
|
|
@ -80,7 +92,10 @@ fi
|
|||
|
||||
body=$(json "$title" "$body" "$branch" "$base")
|
||||
|
||||
curl -u "$user" \
|
||||
-H "X-GitHub-OTP: $mfa_code" \
|
||||
curl \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-H "Authorization: token $personal_access_token" \
|
||||
-H "X-GitHub-OTP: $mfa_code" \
|
||||
"https://api.github.com/repos/$project/pulls" -d "$body"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue