diff --git a/action.yaml b/action.yaml index e7a5e11..00127a1 100644 --- a/action.yaml +++ b/action.yaml @@ -15,6 +15,17 @@ runs: uses: actions/checkout@v3 with: lfs: false + + - name: Create LFS file list + run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id + + - name: Restore LFS cache + uses: actions/cache@v3 + id: lfs-cache + with: + path: .git/lfs + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }} + - name: Checkout LFS if: ${{ inputs.checkout-version == '3' }} run: | @@ -28,11 +39,25 @@ runs: /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 + - name: Checkout if: ${{ inputs.checkout-version == '4' }} uses: actions/checkout@v4 with: lfs: false + + - name: Create LFS file list + run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id + + - name: Restore LFS cache + uses: actions/cache@v3 + id: lfs-cache + with: + path: .git/lfs + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }} + - name: Checkout LFS if: ${{ inputs.checkout-version == '4' }} run: | @@ -45,4 +70,6 @@ runs: git config --local lfs.transfer.maxretries 1 /usr/bin/git lfs fetch origin refs/remotes/origin/${{ gitea.ref_name }} - /usr/bin/git lfs checkout \ No newline at end of file + /usr/bin/git lfs checkout + /usr/bin/git add . + /usr/bin/git reset --hard \ No newline at end of file