checkout icon indicating copy to clipboard operation
checkout copied to clipboard

Why do I have to pull the lfs separately when using lfs: 'true'

Open gary-cowell opened this issue 4 years ago • 17 comments

                  - name: checkout
                    uses: actions/checkout@v2
                    with:
                        lfs: 'true'
                  - name: checkoutLFS
                    uses: actions/checkout@v2
                  - run: git lfs pull

With only the first of those, the source checkout has LFS which look like this:

-rw-r--r-- 1 runner docker 133 Jun 1 15:54 largefile.zip

I.e. that's a reference only.

After the extra pull, I see:

-rw-r--r-- 1 runner docker 28956993 Jun 2 07:08 largefile.zip

The lfs: 'true' is having some effect on the first checkout because I can see it installing LFS and issuing:

/usr/bin/git lfs fetch origin refs/remotes/origin/mybranch

That does not appear to take enough time to be fetching the actual lfs, then it runs

/usr/bin/git checkout --progress --force -B mybranch refs/remotes/origin/mybranch

Which still leaves us with a reference file.

It's only when I run the second checkout and force a 'git lfs pull' do I get the actual file. I don't see any errors in the first checkout step.

gary-cowell avatar Jun 02 '20 07:06 gary-cowell