From 2889170a09bb5199d6b7b3eaaa32d48f008216f8 Mon Sep 17 00:00:00 2001 From: Itms Date: Sat, 10 May 2025 09:54:18 +0200 Subject: [PATCH] Check LFS pointers integrity in an action Running the checks here instead of in repository hooks will prevent Gitea from hanging during pushes. --- .gitea/workflows/checkrefs.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.gitea/workflows/checkrefs.yml b/.gitea/workflows/checkrefs.yml index 34445cda2c..3b67dd589b 100644 --- a/.gitea/workflows/checkrefs.yml +++ b/.gitea/workflows/checkrefs.yml @@ -3,7 +3,22 @@ name: checkrefs on: - push - pull_request +env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + jobs: + lfscheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Fetch the base branch + run: git fetch origin ${{ env.BASE_SHA }} + + - name: Check that LFS files are correctly stored as pointers + run: git-lfs fsck --pointers ${{ env.BASE_SHA }}..${{ env.HEAD_SHA }} + checkrefs: runs-on: ubuntu-latest env: