Skip to content
LatchkeyLatchkey home

GitHub Actions checkout missing "lfs: true" in CI

actions/checkout defaults to lfs: false, so it clones the repo with LFS pointers but does not download the objects. Any step that reads a tracked binary then sees pointer text instead of content.

What this error means

A workflow builds cleanly locally but fails in CI when a binary asset is unreadable, and the file contents show an LFS pointer rather than the real data.

git-lfs
# a step reads a model file that is actually a pointer
$ file assets/model.bin
assets/model.bin: ASCII text
$ head -1 assets/model.bin
version https://git-lfs.github.com/spec/v1

Common causes

The checkout step omits lfs: true

Without the input, actions/checkout skips the LFS fetch entirely, leaving pointers in the working tree.

A cached checkout config without LFS

Copied workflows often keep the default checkout, so LFS is silently never fetched in that job.

How to fix it

Add lfs: true to the checkout

  1. Set lfs: true on the actions/checkout step in each job that needs binaries.
  2. Optionally cache .git/lfs to speed up repeat runs.
  3. Re-run and confirm the assets are real content.
.github/workflows/ci.yml
- uses: actions/checkout@v4
  with:
    lfs: true

Pull LFS after checkout if you cannot change the step

When the checkout is shared, add a follow-up git lfs pull to materialize objects.

.github/workflows/ci.yml
- run: git lfs pull

Using this in CI

CI checkouts are shallow and detached by default, which changes the answer this command gives you. Commands that read history, branch names, or tags need the checkout configured for it.

.github/workflows/ci.yml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0   # history, tags, and git describe all need this

- run: |
    git rev-parse --is-shallow-repository   # expect false
    git rev-parse --abbrev-ref HEAD          # prints HEAD when detached

How to prevent it

  • Standardize lfs: true in workflow templates that use LFS.
  • Cache .git/lfs to keep the fetch cheap.
  • Assert a known binary is not pointer text as an early CI check.

Frequently asked questions

What causes GitHub Actions checkout missing "lfs: true" in CI?
There are 2 common causes: the checkout step omits lfs: true and a cached checkout config without lfs. Without the input, actions/checkout skips the LFS fetch entirely, leaving pointers in the working tree.
How do I fix GitHub Actions checkout missing "lfs: true" in CI?
There are 2 fixes depending on which cause you have: add lfs: true to the checkout and pull lfs after checkout if you cannot change the step. Work through them in order, since the first is the most common.
What does GitHub Actions checkout missing "lfs: true" in CI actually mean?
A workflow builds cleanly locally but fails in CI when a binary asset is unreadable, and the file contents show an LFS pointer rather than the real data.
How do I stop GitHub Actions checkout missing "lfs: true" in CI happening again?
Standardize lfs: true in workflow templates that use LFS. The prevention section lists 3 changes that keep it from recurring.

Related guides

References

Not every red build is your code. Latchkey repairs the ones that are not, on the runner. Start free → 30-day trial · No credit card