Skip to content

Commit bc0c23b

Browse files
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>
1 parent 644e4fb commit bc0c23b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
java-version: 21
2525
- uses: gradle/actions/setup-gradle@v3
2626

27+
- run: ./scripts/enforce_git_lfs.sh
2728
- run: ./gradlew kotlinUpgradeYarnLock build -PredwoodNoApps
2829

2930
emulator-tests:

scripts/enforce_git_lfs.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
output=$(git checkout .)
4+
5+
if [[ output == *"files that should have been pointers, but weren't"* ]]; then
6+
echo "Error: Encountered files that should have been checked in using Git LFS, but weren't."
7+
exit 1
8+
else
9+
exit 0
10+
fi

0 commit comments

Comments
 (0)