Skip to content

Commit bf5131f

Browse files
committed
Report success or failure depending on flake8 outcome.
1 parent bc1df63 commit bf5131f

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

flake8_github_action/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,15 @@ def action(
113113
# Github limits updates to 50 annotations at a time
114114
annotation_chunks = list(chunks(annotations, 50))
115115

116+
if flake8_app.result_count:
117+
conclusion = "failure"
118+
else:
119+
conclusion = "success"
120+
116121
for chunk in annotation_chunks[:-1]:
117122
check.update_check_run(
118123
check_run_id,
119-
conclusion="success", # TODO: reflect flake8 output
124+
conclusion=conclusion,
120125
output={
121126
"title": "Flake8 checks",
122127
"summary": "Output from Flake8",

flake8_github_action/__main__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#
2828

2929
# stdlib
30-
import os
3130
import sys
3231
from typing import Union
3332

@@ -71,17 +70,12 @@ def main(ctx: click.Context, token: str, repo: Union[str, URL, None] = None):
7170
# this package
7271
from flake8_github_action import action
7372

74-
print(ctx.args)
75-
7673
response = action(token, repo, *ctx.args)
7774

7875
if response.status_code == 200:
7976
sys.exit(0)
8077

8178

8279
if __name__ == "__main__":
83-
print("GITHUB_RUN_ID:", os.environ["GITHUB_RUN_ID"])
84-
print("GITHUB_WORKFLOW:", os.environ["GITHUB_WORKFLOW"])
85-
8680
sys.exit(main(obj={}))
8781

0 commit comments

Comments
 (0)