This commit is contained in:
alesapin 2021-09-15 16:13:13 +03:00
parent e90322a68d
commit ea72b603b3
2 changed files with 4 additions and 3 deletions

View File

@ -115,10 +115,12 @@ if __name__ == "__main__":
pr_info = PRInfo(event)
can_run, description = should_run_checks_for_pr(pr_info)
gh = Github(os.getenv("GITHUB_TOKEN"))
if not can_run:
task_url = f"https://github.com/ClickHouse/ClickHouse/actions/runs/{os.getenv('GITHUB_RUN_ID')}"
print("Commit sha", pr_info.sha)
print("PR number", pr_info.number)
gh = Github(os.getenv("GITHUB_TOKEN"))
commit = get_commit(gh, pr_info.sha)
url = f"https://github.com/ClickHouse/ClickHouse/actions/runs/{os.getenv('GITHUB_RUN_ID')}"
commit.create_status(context=NAME, description=description, state="failed", target_url=url)
commit.create_status(context=NAME, description=description, state="failure", target_url=url)
sys.exit(1)

View File

@ -92,7 +92,6 @@ def update_check_with_curl(check_id):
"--header 'content-type: application/json' "
"-d '{{\"name\" : \"hello-world-name\"}}'")
cmd = cmd_template.format(check_id, os.getenv("GITHUB_TOKEN"))
print("CMD {}", cmd)
subprocess.check_call(cmd, shell=True)
if __name__ == "__main__":