File tree Expand file tree Collapse file tree 5 files changed +34
-5
lines changed
Expand file tree Collapse file tree 5 files changed +34
-5
lines changed Original file line number Diff line number Diff line change @@ -118,9 +118,11 @@ function gh_print_annotation()
118118 local msg=" $3 "
119119
120120 # gh_decode_line_return_chars "$msg"
121- RETURN_VALUE =" ${RETURN_VALUE //% 0D% 0A/ $' \r\n ' \| } "
121+ msg =" ${msg //% 0D% 0A/ $' \r\n ' \| } "
122122
123- # stdout redirection must be issued outside
123+ # NOTE:
124+ # The stdout redirection must be issued outside.
125+ #
124126 echo " ::$annot_type $annot_prefix ::$msg "
125127
126128 gh_process_annotation_print " $annot_type " " $annot_prefix " " $msg "
@@ -129,6 +131,24 @@ function gh_print_annotation()
129131 gh_set_env_var GHWF_ANNOTATIONS_PRINT_BUF_STR " ${GHWF_ANNOTATIONS_PRINT_BUF_STR}${GHWF_ANNOTATIONS_PRINT_BUF_STR: +" ${RETURN_VALUES[0]} " }${RETURN_VALUES[1]} "
130132}
131133
134+ function gh_print_annotation_line()
135+ {
136+ [[ -z " $GITHUB_ACTIONS " ]] && return 0
137+
138+ local line=" $1 "
139+
140+ # gh_decode_line_return_chars "$msg"
141+ line=" ${line//% 0D% 0A/ $' \r\n ' \| } "
142+
143+ # NOTE:
144+ # The stdout redirection must be issued outside.
145+ #
146+ echo " $line "
147+
148+ # duplicate output into `GHWF_ANNOTATIONS_PRINT_BUF_STR` variable to reuse later
149+ gh_set_env_var GHWF_ANNOTATIONS_PRINT_BUF_STR " ${GHWF_ANNOTATIONS_PRINT_BUF_STR}${GHWF_ANNOTATIONS_PRINT_BUF_STR: +$' \r\n ' } $line "
150+ }
151+
132152function gh_flush_print_annotations()
133153{
134154 local IFS
Original file line number Diff line number Diff line change @@ -131,6 +131,8 @@ function gh_print_errors_buffer()
131131{
132132 local buf=" $1 "
133133
134+ [[ -z " $buf " ]] && return 0
135+
134136 local line
135137
136138 # with check on integer value
@@ -143,7 +145,7 @@ function gh_print_errors_buffer()
143145 # fix multiline text in a single argument
144146 gh_encode_line_return_chars " $RETURN_VALUE "
145147
146- gh_print_annotation error ' ' " $RETURN_VALUE "
148+ gh_print_annotation_line " $RETURN_VALUE "
147149 done >&2
148150 else
149151 gh_print_args " $buf " >&2
Original file line number Diff line number Diff line change @@ -131,6 +131,8 @@ function gh_print_notices_buffer()
131131{
132132 local buf=" $1 "
133133
134+ [[ -z " $buf " ]] && return 0
135+
134136 local line
135137
136138 # with check on integer value
@@ -143,7 +145,7 @@ function gh_print_notices_buffer()
143145 # fix multiline text in a single argument
144146 gh_encode_line_return_chars " $RETURN_VALUE "
145147
146- gh_print_annotation notice ' ' " $RETURN_VALUE "
148+ gh_print_annotation_line " $RETURN_VALUE "
147149 done
148150 else
149151 gh_print_args " $buf "
Original file line number Diff line number Diff line change @@ -131,6 +131,8 @@ function gh_print_warnings_buffer()
131131{
132132 local buf=" $1 "
133133
134+ [[ -z " $buf " ]] && return 0
135+
134136 local line
135137
136138 # with check on integer value
@@ -143,7 +145,7 @@ function gh_print_warnings_buffer()
143145 # fix multiline text in a single argument
144146 gh_encode_line_return_chars " $RETURN_VALUE "
145147
146- gh_print_annotation warning ' ' " $RETURN_VALUE "
148+ gh_print_annotation_line " $RETURN_VALUE "
147149 done >&2
148150 else
149151 gh_print_args " $buf " >&2
Original file line number Diff line number Diff line change 1+ 2022.08.18:
2+ * fixed: bash/github: init-print-workflow.sh, print-*.sh: execution fixup
3+
142022.08.16:
25* changed: bash/github/accum-rate-limits.sh: removed usage of a print annotation group because works as not expected (a print does truncate by first `\n` characters and the `%0A` sequence does not work as line return in the job summary annotations)
36
You can’t perform that action at this time.
0 commit comments