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:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
|
git config --global init.defaultBranch main
|
||||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
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 init
|
||||||
git remote add origin "https://${GITEA_TOKEN}@${SERVER_HOST}/${{ github.repository }}.git" || \
|
git remote add origin "$CLONE_URL" || git remote set-url origin "$CLONE_URL"
|
||||||
git remote set-url origin "https://${GITEA_TOKEN}@${SERVER_HOST}/${{ github.repository }}.git"
|
git config http.extraheader "AUTHORIZATION: token ${GITEA_TOKEN}"
|
||||||
git fetch --depth 1 origin "${{ github.sha }}" || git fetch --depth 1 origin main
|
git fetch --depth 1 origin "${{ github.sha }}" || git fetch --depth 1 origin main
|
||||||
git checkout -f FETCH_HEAD
|
git checkout -f FETCH_HEAD
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user