Skip to content

Commit

Permalink
scripts: ci: check_compliance.py: Allow multiline annotations
Browse files Browse the repository at this point in the history
Encode annotation message to allow multiline messages.

Signed-off-by: Pieter De Gendt <[email protected]>
  • Loading branch information
pdgendt authored and nashif committed Aug 9, 2024
1 parent 6901343 commit f21c97a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/ci/check_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1533,10 +1533,11 @@ def annotate(res):
"""
https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#about-workflow-commands
"""
msg = res.message.replace('%', '%25').replace('\n', '%0A').replace('\r', '%0D')
notice = f'::{res.severity} file={res.file}' + \
(f',line={res.line}' if res.line else '') + \
(f',col={res.col}' if res.col else '') + \
f',title={res.title}::{res.message}'
f',title={res.title}::{msg}'
print(notice)


Expand Down

0 comments on commit f21c97a

Please sign in to comment.