Skip to content

Commit

Permalink
take git_statis.txt bytes into account
Browse files Browse the repository at this point in the history
  • Loading branch information
Robpol86 committed Jul 9, 2024
1 parent 29aa1ba commit edad725
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ on:
env:
BRANCH_NAME_HTML_OLD: __diff__html_old
DIFF_CONTEXT: 5
DIFF_TRUNCATE_CHARS: 65536 # TODO implement
DIFF_TRUNCATE_TO_BYTES: 252000
POST_COLLAPSE_GT_LINES: 10

Expand Down Expand Up @@ -92,10 +91,11 @@ jobs:
if: hashFiles('git_diff.patch')
run: |
cp git_diff.patch git_diff.patch.orig
head --bytes="$DIFF_TRUNCATE_TO_BYTES" git_diff.patch.orig > git_diff.patch
truncate_to=$(( DIFF_TRUNCATE_TO_BYTES - $(wc -c < git_status.txt) ))
head --bytes="$truncate_to" git_diff.patch.orig > git_diff.patch
if ! cmp -s git_diff.patch git_diff.patch.orig; then
echo -e "\n\nTruncated" |tee -a git_diff.patch
tail --bytes=+"$(( DIFF_TRUNCATE_TO_BYTES + 1 ))" git_diff.patch.orig > git_diff.patch.truncated
tail --bytes=+"$(( truncate_to + 1 ))" git_diff.patch.orig > git_diff.patch.truncated
fi
rm -v git_diff.patch.orig
- name: Store Metafiles as Temporary Artifacts
Expand Down

0 comments on commit edad725

Please sign in to comment.