Update .gitignore to include scripts for loading environment variables and Git credentials. Remove obsolete documentation files including 100_PERCENT_LINK_VERIFICATION_ACHIEVED.md, CROSS_REFERENCE_VERIFICATION_REPORT.md, DOCUMENT_RELATIONSHIP_VISUALIZATION.md, and several project management reports to streamline the repository and enhance maintainability. Revise DOCUMENT_RELATIONSHIP_MAP.md to correct link paths and add a new section for visual specifications.
This commit is contained in:
30
scripts/git-credential-helper.sh
Executable file
30
scripts/git-credential-helper.sh
Executable 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
|
||||
|
||||
Reference in New Issue
Block a user