aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgh-clone.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/gh-clone.sh b/gh-clone.sh
index 76e7787..04c3f3d 100755
--- a/gh-clone.sh
+++ b/gh-clone.sh
@@ -26,8 +26,13 @@ git clone "https://github.com/${ORIG_REPO}.git"
cd "${DIRNAME}"
# Get credentials
-CREDS=$(echo 'url=https://github.com/${ORIG_REPO}.git'|git credential fill)
-PASSWORD=$(awk -F= '/password/ { print $2 ; exit }')
+# This is still not sufficiently general: git-credential(1) cannot provide
+# anything else than login/password duo, and we need GH personal access
+# token.
+# PASSWORD=$(echo 'url=https://github.com/${ORIG_REPO}.git'|git credential fill| \
+# awk -F= '/password/ { print $2 ; exit }')
+# So, I use this directly, but it is not general enough
+PASSWORD=$(pass show dev/github.com|awk '/^token:/ {print $2}')
# Fork repository
curl -s -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${PASSWORD}" \