Git LFS pointers committed to main branch after GitHub Actions checkout lacked LFS pull: large files missing in CI and deployed artifact
Environment
Monorepo on GitHub using Git LFS for large model assets; CI pipeline runs on GitHub Actions with actions/checkout@v2, build steps that expect real files under 'assets/models'; artifacts deployed to staging via GitHub Pages; repository is public but LFS files tracked and stored in GitHub LFS.
Symptoms
Staging deploys from CI started failing: runtime errors 'cannot open model file' and files under assets/models appear as small text pointer files containing 'version https://git-lfs.github.com/spec/v1' rather than expected binaries; local clones (developer machines) have correct binary files.
Observations
CI job log shows actions/checkout@v2 running with default settings; no 'git lfs pull' step present; previous successful builds used a self-hosted runner that had a global Git LFS cache configured; actions/checkout v2 does not fetch LFS by default unless 'lfs: true' specified; the pointer files in the repo are valid LFS pointers and CI's git status shows no changes; adding an explicit 'git lfs pull' step during CI resolves the problem in test runs.
Already attempted
Added 'with: lfs: true' to actions/checkout step and reran pipeline (fixed in one run); tried adding separate 'git lfs install' + 'git lfs pull' steps as alternative (also fixed). Reverting to older checkout action didn't change behavior. Ensured GITHUB_TOKEN has read access to LFS objects (default).
Question
Why did CI start delivering LFS pointer files instead of real assets, and what is the safest CI change to ensure LFS objects are fetched reliably during GitHub Actions builds without leaking or storing large binaries in the repo history?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags