From c66e929d8bba53989770bcb4a1f9fabf9058139e Mon Sep 17 00:00:00 2001 From: Minimata Date: Sun, 25 Jan 2026 18:38:36 +0100 Subject: [PATCH] fixing lfs checkout --- .gitea/workflows/dev-branch.yaml | 54 +++++++++++++++++++------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/.gitea/workflows/dev-branch.yaml b/.gitea/workflows/dev-branch.yaml index d1f01061..3bd023b1 100644 --- a/.gitea/workflows/dev-branch.yaml +++ b/.gitea/workflows/dev-branch.yaml @@ -32,31 +32,41 @@ jobs: uses: actions/checkout@v6 with: lfs: false - - - name: Create LFS file list - run: /usr/bin/git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id - - - name: Restore LFS cache - uses: actions/cache@v5 - id: lfs-cache - with: - path: .git/lfs - key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }} + persist-credentials: true - name: Checkout LFS run: | - UrlBase=$GITHUB_SERVER_URL; \ - UrlLfsBase=$UrlBase/${{ gitea.repository }}.git/info/lfs/objects; \ - Auth=`/usr/bin/git config --get --local http.$UrlBase/.extraheader`; \ - /usr/bin/git config --local http.${UrlLfsBase}/batch.extraheader "$Auth"; \ - /usr/bin/git config --local http.${UrlLfsBase}/.extraheader '' - - git config --local lfs.transfer.maxretries 1 - - /usr/bin/git lfs fetch origin refs/remotes/origin/${{ gitea.ref_name }} - /usr/bin/git lfs checkout - /usr/bin/git add . - /usr/bin/git reset --hard + git lfs install --local + AUTH=$(git config http.${{ gitea.server_url }}/.extraheader) + AUTH_FILE=$(git config includeif.gitdir:/workspace/${{ gitea.repository }}/.git.path) + git config -f $AUTH_FILE --unset http.${{ gitea.server_url }}/.extraheader + git config -f $AUTH_FILE http.${{ gitea.server_url }}/${{ gitea.repository }}.git/info/lfs/objects/batch.extraheader "$AUTH" + git lfs pull + +# - name: Create LFS file list +# run: /usr/bin/git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id +# +# - name: Restore LFS cache +# uses: actions/cache@v5 +# id: lfs-cache +# with: +# path: .git/lfs +# key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }} +# +# - name: Checkout LFS +# run: | +# UrlBase=$GITHUB_SERVER_URL; \ +# UrlLfsBase=$UrlBase/${{ gitea.repository }}.git/info/lfs/objects; \ +# Auth=`/usr/bin/git config --get --local http.$UrlBase/.extraheader`; \ +# /usr/bin/git config --local http.${UrlLfsBase}/batch.extraheader "$Auth"; \ +# /usr/bin/git config --local http.${UrlLfsBase}/.extraheader '' +# +# git config --local lfs.transfer.maxretries 1 +# +# /usr/bin/git lfs fetch origin refs/remotes/origin/${{ gitea.ref_name }} +# /usr/bin/git lfs checkout +# /usr/bin/git add . +# /usr/bin/git reset --hard # Cache - name: Restore Assets