Skip to content

Commit

Permalink
use git credentials instead of url rewrites
Browse files Browse the repository at this point in the history
  • Loading branch information
ninetyninereds committed Sep 12, 2023
1 parent 2190fd5 commit 85868de
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

20 changes: 14 additions & 6 deletions dist/platforms/ubuntu/steps/set_gitcredential.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@ else
echo "GIT_PRIVATE_TOKEN is set configuring git credentials"

git config --global credential.helper store
git config --global --replace-all url."https://token:$GIT_PRIVATE_TOKEN@github.com/".insteadOf ssh://git@github.com/
git config --global --add url."https://token:$GIT_PRIVATE_TOKEN@github.com/".insteadOf git@github.com
git config --global --add 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:"

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

Expand Down

0 comments on commit 85868de

Please sign in to comment.