ci: preserve http protocol for internal gitea runner clone
All checks were successful
ESP32 Build & Release / build (push) Successful in 1m17s
All checks were successful
ESP32 Build & Release / build (push) Successful in 1m17s
This commit is contained in:
@@ -20,11 +20,12 @@ jobs:
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
git config --global init.defaultBranch main
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
SERVER_HOST=$(echo "${{ github.server_url }}" | sed -e 's|^https://||' -e 's|^http://||')
|
||||
CLONE_URL=$(echo "${{ github.server_url }}" | sed -E "s|^(https?://)|\1${GITEA_TOKEN}@|")/${{ github.repository }}.git
|
||||
git init
|
||||
git remote add origin "https://${GITEA_TOKEN}@${SERVER_HOST}/${{ github.repository }}.git" || \
|
||||
git remote set-url origin "https://${GITEA_TOKEN}@${SERVER_HOST}/${{ github.repository }}.git"
|
||||
git remote add origin "$CLONE_URL" || git remote set-url origin "$CLONE_URL"
|
||||
git config http.extraheader "AUTHORIZATION: token ${GITEA_TOKEN}"
|
||||
git fetch --depth 1 origin "${{ github.sha }}" || git fetch --depth 1 origin main
|
||||
git checkout -f FETCH_HEAD
|
||||
|
||||
|
||||
Reference in New Issue
Block a user