name: Git LFS pull
description: Cached Git LFS pull.

runs:
  using: "composite"
  steps:
    - name: Create LFS file list
      shell: bash
      run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id

    - name: Restore LFS cache
      uses: actions/cache@v4
      with:
        path: .git/lfs/objects
        key: lfs-${{ hashFiles('.lfs-assets-id') }}
        restore-keys: lfs-
        enableCrossOsArchive: true

    - name: Git LFS pull
      shell: bash
      run: |
        git lfs pull
        git lfs prune