Skip to content

Commit fa6a988

Browse files
committed
Resolve actions command warning
If line and endLine are different (like a range usually is), then it can't cope with col and endColumn being set: ``` Invalid error command value. 'col' and 'endColumn' cannot be set if 'line' and 'endLine' are different values. ```
1 parent 81f352f commit fa6a988

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

image/tools/convert_validate_report.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ def convert_to_github(report: Dict, base_path: str) -> Iterable[str]:
2525
params['endLine'] = diag['range']['end']['line']
2626
params['endColumn'] = diag['range']['end']['column']
2727

28+
if params.get('line') != params.get('endLine'):
29+
# GitHub can't cope with 'col' and 'endColumn' if 'line' and 'endLine' are different values.
30+
if 'col' in params:
31+
del params['col']
32+
if 'endColumn' in params:
33+
del params['endColumn']
34+
2835
summary = diag['summary'].split('\n')[0]
2936
params = ','.join(f'{k}={v}' for k, v in params.items())
3037

0 commit comments

Comments
 (0)