File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -30,3 +30,20 @@ diff-crd:
30
30
- git diff
31
31
- test -z "$(git diff 2> /dev/null)" || exit "CRD generation was not generated, issue \`make cr_generate\` and commit the result"
32
32
- test -z "$(git ls-files --others --exclude-standard 2> /dev/null)" || exit "CRD generation created untracked files, cannot proceed"
33
+ check-large-files :
34
+ stage : diff
35
+ tags :
36
+ - go
37
+ script :
38
+ # List all files in the latest commit that are larger than 1MB
39
+ - git ls-tree -r HEAD --long | awk '$4 > 1048576 { print $0 }' > large_files.txt
40
+
41
+ # Fail the job if any file is larger than 1MB
42
+ - |
43
+ if [ -s large_files.txt ]; then
44
+ echo "❌ The following files exceed 1MB:"
45
+ cat large_files.txt
46
+ exit 1
47
+ else
48
+ echo "✅ No large files found in the latest commit."
49
+ fi
You can’t perform that action at this time.
0 commit comments