File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
booster/.github/actions/php-auto-fix Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ inputs:
2828 required : false
2929 default : " *.php"
3030
31+ max-lines :
32+ description : " Maximum lines of code to process (default: 500)"
33+ required : false
34+ default : " 500"
35+
3136outputs :
3237 changes-made :
3338 description : " Whether any changes were made"
@@ -112,11 +117,24 @@ runs:
112117 CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD -- '${{ inputs.file-pattern }}' 2>/dev/null | tr '\n' ' ' || echo "")
113118 fi
114119
115- # Filter to only existing files
120+ # Filter to only existing files and check line count
116121 EXISTING_FILES=""
122+ MAX_LINES=${{ inputs.max-lines }}
123+
117124 for file in $CHANGED_FILES; do
118125 if [ -f "$file" ]; then
119- EXISTING_FILES="$EXISTING_FILES $file"
126+ # Skip vendor files
127+ if [[ "$file" == vendor/* ]] || [[ "$file" == */vendor/* ]]; then
128+ echo "ℹ️ Skipping vendor file: $file"
129+ continue
130+ fi
131+
132+ LINE_COUNT=$(wc -l < "$file" 2>/dev/null || echo "0")
133+ if [ "$LINE_COUNT" -le "$MAX_LINES" ]; then
134+ EXISTING_FILES="$EXISTING_FILES $file"
135+ else
136+ echo "⚠️ Skipping large file: $file (${LINE_COUNT} lines > ${MAX_LINES} lines)"
137+ fi
120138 fi
121139 done
122140
You can’t perform that action at this time.
0 commit comments