File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 3
3
set -euo pipefail
4
4
5
5
PLUGIN_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) /.."
6
+ MAX_SIZE=100 # in KB
6
7
7
8
echo " --- :junit: Download the junits"
8
9
@@ -15,6 +16,12 @@ function cleanup {
15
16
rm -rf " ${annotation_dir} "
16
17
}
17
18
19
+ function check_size {
20
+ local size_in_kb
21
+ size_in_kb=$( du -k " ${annotation_path} " | cut -f 1)
22
+ [ " ${size_in_kb} " -lt " ${MAX_SIZE} " ]
23
+ }
24
+
18
25
trap cleanup EXIT
19
26
20
27
buildkite-agent artifact download \
@@ -37,6 +44,12 @@ docker \
37
44
cat " $annotation_path "
38
45
39
46
if grep -q " <details>" " $annotation_path " ; then
47
+
48
+ if ! check_size; then
49
+ echo " --- :hurtrealbad: Sorry, annotation is too big to publish"
50
+ exit 1
51
+ fi
52
+
40
53
echo " --- :buildkite: Creating annotation"
41
54
# shellcheck disable=SC2002
42
55
cat " $annotation_path " | buildkite-agent annotate --context junit --style error
You can’t perform that action at this time.
0 commit comments