Add a CI check to enforce that files use git lfs when necessary. (#2025)

* Add a CI check to enforce that files use git lfs when necessary.

* Remove echo.

* Improve error message.

* Improve error message.

* Update scripts/enforce_git_lfs.sh

Co-authored-by: Jake Wharton <jw@squareup.com>

* Use bash substring matching.

---------

Co-authored-by: Jake Wharton <jw@squareup.com>
This commit is contained in:
Colin White
2024-05-14 12:08:24 -05:00
committed by GitHub
parent 644e4fb6b8
commit bc0c23ba70
2 changed files with 11 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ jobs:
java-version: 21
- uses: gradle/actions/setup-gradle@v3
- run: ./scripts/enforce_git_lfs.sh
- run: ./gradlew kotlinUpgradeYarnLock build -PredwoodNoApps
emulator-tests:

10
scripts/enforce_git_lfs.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
output=$(git checkout .)
if [[ output == *"files that should have been pointers, but weren't"* ]]; then
echo "Error: Encountered files that should have been checked in using Git LFS, but weren't."
exit 1
else
exit 0
fi