unity-builder/dist/platforms/ubuntu/steps/set_gitcredential.sh
2023-09-12 22:33:42 +03:00

33 lines
752 B
Bash
Executable File

#!/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
echo "activating credential halper..."
git config --global credential.helper store
echo "writing credentials to helper..."
{
echo protocol=https
echo host=github.com
echo username=token
echo password=$GIT_PRIVATE_TOKEN
} | git credential approve
echo "displaying credentials file..."
cat $HOME/.git-credentials
fi
echo "---------- git config --list -------------"
git config --list
echo "---------- git config --list --show-origin -------------"
git config --list --show-origin