🤔 Background
GitHub parses a workflow command as ::level prop=value,prop=value::message, splitting the property list on ,. bashunit::reports::print_gha_annotations (src/reports/gha.sh) interpolates file= and title= raw, so a title holding a comma ends the title there.
functiontest_titled() {
bashunit::set_test_title "Rejects a,b when x:y is set"
assert_same "expected""actual"
}::error file=tests/t_test.sh,line=1,title=Rejects a,b when x:y is set::✗ Failed: ...
Parsed as GitHub parses it:
'file' -> 'tests/t_test.sh'
'line' -> '1'
'title' -> 'Rejects a'
'b when x:y is set' -> ''
The annotation's title is truncated and an invented property appears. set_test_title takes arbitrary text, so a comma in it is ordinary usage. A file path containing a comma does the same to file=.
💡 Cause
A property value carries a stricter encoding rule than the message: the spec reserves %, \r, \n, : and ,, while the message needs only the first three. bashunit::reports::__gha_encode implements the message rule — correctly, including the [%] workaround for Bash 3.0 reading a bare % after // as anchor-to-end (#1121) — and is not applied to the properties at all.
A property encoder built on top of it, adding %3A and %2C, fixes both file= and title=. line= is an integer bashunit produces and needs nothing.
💡 Found by
Continuing the report-writer sweep from #1305 into the GHA writer.
🤔 Background
GitHub parses a workflow command as
::level prop=value,prop=value::message, splitting the property list on,.bashunit::reports::print_gha_annotations(src/reports/gha.sh) interpolatesfile=andtitle=raw, so a title holding a comma ends the title there.Parsed as GitHub parses it:
The annotation's title is truncated and an invented property appears.
set_test_titletakes arbitrary text, so a comma in it is ordinary usage. A file path containing a comma does the same tofile=.💡 Cause
A property value carries a stricter encoding rule than the message: the spec reserves
%,\r,\n,:and,, while the message needs only the first three.bashunit::reports::__gha_encodeimplements the message rule — correctly, including the[%]workaround for Bash 3.0 reading a bare%after//as anchor-to-end (#1121) — and is not applied to the properties at all.A property encoder built on top of it, adding
%3Aand%2C, fixes bothfile=andtitle=.line=is an integer bashunit produces and needs nothing.💡 Found by
Continuing the report-writer sweep from #1305 into the GHA writer.