From 12626949fe18b095f99de017ad07277fed86a2a2 Mon Sep 17 00:00:00 2001 From: Michael Hermann Date: Thu, 20 Nov 2025 01:45:30 +0100 Subject: [PATCH] Optimize git operations: Add timeout, improve config, use shallow clone --- .gitea/workflows/update-laws.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/update-laws.yaml b/.gitea/workflows/update-laws.yaml index 466a7f79..37fc52eb 100644 --- a/.gitea/workflows/update-laws.yaml +++ b/.gitea/workflows/update-laws.yaml @@ -16,11 +16,15 @@ jobs: git config --global user.name 'LawGit Bot' git config --global user.email 'bot@git.coded.law' git config --global init.defaultBranch main + git config --global http.postBuffer 524288000 + git config --global http.lowSpeedLimit 0 + git config --global http.lowSpeedTime 0 - name: Checkout repository run: | - git clone https://git.coded.law/${{ github.repository }}.git . + git clone --depth=1 https://git.coded.law/${{ github.repository }}.git . git remote set-url origin https://git.coded.law/${{ github.repository }}.git + git fetch --unshallow || true - name: Set up Python run: | @@ -82,7 +86,8 @@ jobs: echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT git checkout -b $BRANCH_NAME git commit -m "Update laws from RSS - $(date +'%Y-%m-%d %H:%M:%S UTC')" || exit 0 - git push origin $BRANCH_NAME || echo "Push fehlgeschlagen" + # Push with timeout (10 minutes max) and progress output + timeout 600 git push --progress origin $BRANCH_NAME 2>&1 || echo "Push fehlgeschlagen oder Timeout" - name: Create Pull Request if: steps.check_changes.outputs.changed == 'true'