Add gitPrivateToken (#296)
* adding option to pass git credential * trigger change * trigger change * build dist/index * prettier * adding set git credentials with more config * correct docker.ts input * change default of git credential * try using git command line to set token * remove git config cat * adding api: to git config * change to token * change input name to reflect the type github private token Co-authored-by: Alexander Brandstedt <alexander@infralium.com> Co-authored-by: Alexander Brandstedt <mad01@users.noreply.github.com>
This commit is contained in:
24
dist/steps/set_gitcredential.sh
vendored
Executable file
24
dist/steps/set_gitcredential.sh
vendored
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ -z "${GIT_PRIVATE_TOKEN}" ]
|
||||
then
|
||||
echo "GIT_PRIVATE_TOKEN unset skipping"
|
||||
else
|
||||
echo "GIT_PRIVATE_TOKEN is set configuring git credentials"
|
||||
|
||||
git config --global credential.helper store
|
||||
git config --global --replace-all url.https://github.com/.insteadOf ssh://git@github.com/
|
||||
git config --global --add url.https://github.com/.insteadOf git@github.com
|
||||
|
||||
git config --global url."https://token:$GIT_PRIVATE_TOKEN@github.com/".insteadOf "https://github.com/"
|
||||
git config --global url."https://ssh:$GIT_PRIVATE_TOKEN@github.com/".insteadOf "ssh://git@github.com/"
|
||||
git config --global url."https://git:$GIT_PRIVATE_TOKEN@github.com/".insteadOf "git@github.com:"
|
||||
|
||||
fi
|
||||
|
||||
echo "---------- git config --list -------------"
|
||||
git config --list
|
||||
|
||||
echo "---------- git config --list --show-origin -------------"
|
||||
git config --list --show-origin
|
||||
|
||||
Reference in New Issue
Block a user