Skip to content

Commit

Permalink
fix: split size by byte when file bigger than max size
Browse files Browse the repository at this point in the history
  • Loading branch information
jkleinlercher authored Nov 12, 2024
1 parent ce85838 commit 169f730
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/create-pr-comment-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ for file in ${comment_files_csplit}; do
current_size=$((current_size + file_size))

echo "Added '$file' to '$OUTPUT_FILE'. Current size: $current_size bytes."

# if output file is bigger than max size, split the file by byte
if (( $(stat -c %s "$OUTPUT_FILE") > MAX_SIZE )); then
echo "split file ${OUTPUT_FILE} by byte because its file is bigger than ${MAX_SIZE} byte"
split -b ${MAX_SIZE} ${OUTPUT_FILE} ${OUTPUT_FILE}_
fi

else
echo "'$file' is not a valid file. Skipping."
fi
Expand Down

0 comments on commit 169f730

Please sign in to comment.