Skip to content

Commit 43e98f8

Browse files
committed
build.yaml: Avoid too long code_samples_usage.diff.md
1 parent e40ce72 commit 43e98f8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/build.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,15 @@ jobs:
173173
- name: Convert code_samples usages for comment
174174
if: steps.list.outputs.CODE_SAMPLES_CHANGE != '' && steps.diff.outputs.CODE_SAMPLES_DIFF != '0'
175175
run: |
176-
echo '# code_samples/ change report' >> code_samples_usage.diff.md
176+
echo '# code_samples/ change report' > code_samples_usage.diff.md
177177
echo '' >> code_samples_usage.diff.md
178178
php tools/code_samples/code_samples_usage_diff2html.php $HOME/code_samples_usage.diff >> code_samples_usage.diff.md
179179
echo '<a href="${{ steps.artifact.outputs.artifact-url }}">Download colorized diff</a>' >> code_samples_usage.diff.md
180+
if [[ `wc -c < code_samples_usage.diff.md | xargs` -ge $((2**16)) ]]; then
181+
echo '# code_samples/ change report' > code_samples_usage.diff.md
182+
echo '' >> code_samples_usage.diff.md
183+
echo 'Diff is too long to be displayed.' >> code_samples_usage.diff.md
184+
fi
180185
- name: Find Comment
181186
id: find-comment
182187
uses: peter-evans/find-comment@v3

0 commit comments

Comments
 (0)