Add environment setup instructions to README.md

This commit is contained in:
defiQUG
2025-12-07 10:53:30 -08:00
parent cab90527c0
commit 3c1e240678
17 changed files with 3523 additions and 0 deletions

30
git-credential-helper.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
# Git credential helper that uses GITHUB_TOKEN from .env file
if [ "$1" = get ]; then
# Load .env if it exists
if [ -f .env ]; then
export $(grep -v '^#' .env | xargs)
fi
# Read the input
protocol=""
host=""
path=""
while IFS= read -r line; do
case "$line" in
protocol=*) protocol="${line#*=}" ;;
host=*) host="${line#*=}" ;;
path=*) path="${line#*=}" ;;
esac
done
# Only handle GitHub HTTPS URLs
if [ "$protocol" = "https" ] && [ "$host" = "github.com" ]; then
if [ -n "$GITHUB_TOKEN" ]; then
echo "username=git"
echo "password=$GITHUB_TOKEN"
fi
fi
fi