Skip to content

Commit af8fd4a

Browse files
committed
scripts: Return non-zero error code, unless stdin is empty
1 parent 68b64f5 commit af8fd4a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/typos_json_to_gha.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44

55

66
def main():
7+
error_code = 0
8+
79
# Standard Github message template for CI annotations
810
message_template = Template(
911
'::error file=$path,line=$line_num,col=$byte_offset,endcol=$end_col,'
1012
'title=$type::`$typo` should be $suggestions'
1113
)
1214

1315
for line in sys.stdin:
16+
error_code = 1
1417
# Grab the JSON data coming from typos from stdin
1518
data = json.loads(line.rstrip())
1619

@@ -34,6 +37,8 @@ def main():
3437
print(f'{data}')
3538
print(f'{e}')
3639

40+
return error_code
41+
3742

3843
if __name__ == '__main__':
3944
exit(main())

0 commit comments

Comments
 (0)