Skip to content

Commit

Permalink
Add a CI check to enforce that files use git lfs when necessary. (#2025)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Use bash substring matching.

---------

Co-authored-by: Jake Wharton <[email protected]>
  • Loading branch information
colinrtwhite and JakeWharton authored May 14, 2024
1 parent 644e4fb commit bc0c23b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 10 additions & 0 deletions scripts/enforce_git_lfs.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit bc0c23b

Please sign in to comment.