aboutsummaryrefslogtreecommitdiffstats
path: root/gh-clone.sh
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2023-02-15 01:02:29 +0100
committerMatěj Cepl <mcepl@cepl.eu>2024-07-19 10:32:49 +0200
commitce071d4a5db215cce8417162a6d50bb3060c57e1 (patch)
tree522e52929585b3474d18078a70f4569c0ee0441a /gh-clone.sh
parentc8464d17de51ba92e0cdef149d131f1d0e3e4be8 (diff)
downloadhlupak-ce071d4a5db215cce8417162a6d50bb3060c57e1.tar.gz
Actually, we cannot switch to git-credentials.
git-credential(1) cannot provide anything else than login/password duo, and we need GH personal access token.
Diffstat (limited to 'gh-clone.sh')
-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}" \