Skip to content

Commit

Permalink
[ci] Try GITHUB_TOKEN
Browse files Browse the repository at this point in the history
  • Loading branch information
feisuzhu committed Dec 17, 2024
1 parent 9a1e13e commit 969484a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/scripts/common-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ set -x
function unset-git-caching-proxy {
echo "Unsetting git caching proxy"
git config --global --unset-all url.http://git-cdn-github.botmaster.tgr/.insteadOf || true
git config --global --unset-all url.http://git-cdn-gitlab.botmaster.tgr/.insteadOf || true
# git config --global --unset-all url.http://git-cdn-gitlab.botmaster.tgr/.insteadOf || true
rm -f ~/.git-credentials
}

function set-git-caching-proxy {
return # Disable git caching proxy, modified git-cdn image is lost
trap unset-git-caching-proxy EXIT
echo "Setting git caching proxy"
git config --global --add url.http://git-cdn-github.botmaster.tgr/.insteadOf https://github.com/
git config --global --add url.http://git-cdn-github.botmaster.tgr/.insteadOf [email protected]:
git config --global --add url.http://git-cdn-gitlab.botmaster.tgr/.insteadOf https://gitlab.com/
# git config --global --add url.http://git-cdn-gitlab.botmaster.tgr/.insteadOf https://gitlab.com/
git config --global credentials.helper store
echo "http://oauth2:$GITHUB_TOKEN@git-cdn-github.botmaster.tgr" > ~/.git-credentials
}

if [ ! -z "$TI_USE_GIT_CACHE" ]; then
Expand Down

0 comments on commit 969484a

Please sign in to comment.