[macos-runner] Guard checkout against hanging on prompts or a stalled clone

git clone froze for 9+ minutes on one run with no clear cause. Set
GIT_TERMINAL_PROMPT=0 so it fails fast instead of hanging if credential
auth ever goes wrong, and abort via http.lowSpeedLimit/lowSpeedTime if
the transfer genuinely stalls instead of just being slow.
This commit is contained in:
Daniel Arantes Loverde
2026-07-31 09:32:10 -03:00
parent 303886b103
commit 47cf46e007
3 changed files with 6 additions and 3 deletions

View File

@@ -24,9 +24,10 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
run: | run: |
export GIT_TERMINAL_PROMPT=0
REPO_URL="${{ gitea.server_url }}/${{ gitea.repository }}.git" REPO_URL="${{ gitea.server_url }}/${{ gitea.repository }}.git"
AUTH_URL="$(echo "$REPO_URL" | sed "s#https://#https://x-access-token:${{ gitea.token }}@#")" AUTH_URL="$(echo "$REPO_URL" | sed "s#https://#https://x-access-token:${{ gitea.token }}@#")"
git clone "$AUTH_URL" . git -c http.lowSpeedLimit=1000 -c http.lowSpeedTime=30 clone "$AUTH_URL" .
git checkout "${{ gitea.sha }}" git checkout "${{ gitea.sha }}"
- name: Set build number - name: Set build number

View File

@@ -24,9 +24,10 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
run: | run: |
export GIT_TERMINAL_PROMPT=0
REPO_URL="${{ gitea.server_url }}/${{ gitea.repository }}.git" REPO_URL="${{ gitea.server_url }}/${{ gitea.repository }}.git"
AUTH_URL="$(echo "$REPO_URL" | sed "s#https://#https://x-access-token:${{ gitea.token }}@#")" AUTH_URL="$(echo "$REPO_URL" | sed "s#https://#https://x-access-token:${{ gitea.token }}@#")"
git clone "$AUTH_URL" . git -c http.lowSpeedLimit=1000 -c http.lowSpeedTime=30 clone "$AUTH_URL" .
git checkout "${{ gitea.sha }}" git checkout "${{ gitea.sha }}"
- name: Verify ASC secrets - name: Verify ASC secrets

View File

@@ -19,9 +19,10 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
run: | run: |
export GIT_TERMINAL_PROMPT=0
REPO_URL="${{ gitea.server_url }}/${{ gitea.repository }}.git" REPO_URL="${{ gitea.server_url }}/${{ gitea.repository }}.git"
AUTH_URL="$(echo "$REPO_URL" | sed "s#https://#https://x-access-token:${{ gitea.token }}@#")" AUTH_URL="$(echo "$REPO_URL" | sed "s#https://#https://x-access-token:${{ gitea.token }}@#")"
git clone "$AUTH_URL" . git -c http.lowSpeedLimit=1000 -c http.lowSpeedTime=30 clone "$AUTH_URL" .
git checkout "${{ gitea.sha }}" git checkout "${{ gitea.sha }}"
- name: Run unit tests - name: Run unit tests