File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,11 +5,10 @@ set -e # Exit immediately on any error
55
66# Use HTTPS with token if available, otherwise try SSH
77if [ -n " $GITHUB_TOKEN " ]; then
8- # Configure git to use token for HTTPS
9- # This allows access to private repositories without SSH setup
10- git config --global url." https://${GITHUB_TOKEN} @github.com/" .insteadOf " https://github.com/"
11- git config --global url." https://${GITHUB_TOKEN} @github.com/" .insteadOf " git@github.com:"
12- echo " Configured git to use GitHub token for private repository access"
8+ git config --global credential.helper store
9+ echo " https://${GITHUB_TOKEN} @github.com" > ~ /.git-credentials
10+ chmod 600 ~ /.git-credentials
11+ echo " Configured git credential helper for GitHub token"
1312elif [ -n " $GIT_SSH_KEY " ]; then
1413 # Fallback to SSH if token is not available
1514 mkdir -p ~ /.ssh || { echo " Failed to create ~/.ssh directory" >&2 ; exit 1; }
You can’t perform that action at this time.
0 commit comments