diff --git a/.github/workflows/scripts/common-utils.ps1 b/.github/workflows/scripts/common-utils.ps1 index c1d19d0753f75..c664ddb383e07 100644 --- a/.github/workflows/scripts/common-utils.ps1 +++ b/.github/workflows/scripts/common-utils.ps1 @@ -1,14 +1,16 @@ function UnsetGitCachingProxy { Write-Host "Unsetting git caching proxy" git config --global --unset-all url.http://git-cdn-github.botmaster.tgr/.insteadOf - git config --global --unset-all url.http://git-cdn-gitlab.botmaster.tgr/.insteadOf + # git config --global --unset-all url.http://git-cdn-gitlab.botmaster.tgr/.insteadOf } function SetGitCachingProxy { Write-Host "Setting up 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 git@github.com: - 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 credential.helper store + "http://oauth2:${env:GITHUB_TOKEN}@git-cdn-github.botmaster.tgr" | Out-File -FilePath ~\.git-credentials } if($env:TI_USE_GIT_CACHE) { @@ -242,6 +244,7 @@ function CIDockerRun { -e PIP_CACHE_DIR=X:/pip-cache ` -e GIT_ALTERNATE_OBJECT_DIRECTORIES=X:/git-cache/objects ` -e TI_CI=1 ` + -e GITHUB_TOKEN ` @TiEnvs ` -v (($env:LocalAppData -replace "\\", "/") + "/build-cache:X:") ` @extraArgs ` diff --git a/.github/workflows/scripts/common-utils.sh b/.github/workflows/scripts/common-utils.sh index 2672e0d7caf6c..1873bb52235fe 100644 --- a/.github/workflows/scripts/common-utils.sh +++ b/.github/workflows/scripts/common-utils.sh @@ -139,6 +139,7 @@ function ci-docker-run { -e SCCACHE_ROOT=/var/lib/sccache \ -e CACHE_HOME=/var/lib/cache-home \ -e GIT_ALTERNATE_OBJECT_DIRECTORIES=/var/lib/git-cache/objects \ + -e GITHUB_TOKEN \ -v $(readlink -f $CACHE_HOME):/var/lib/cache-home \ -v $(readlink -f $CACHE_HOME/sccache):/var/lib/sccache \ -v $(readlink -f $CACHE_HOME/git-cache):/var/lib/git-cache \