fail_simple_check is added

This commit is contained in:
Yakov Olkhovskiy 2022-07-19 08:57:03 -04:00 committed by Yakov Olkhovskiy
parent c4073328fa
commit f30b54a392

View File

@ -3,7 +3,7 @@
import time import time
import os import os
import csv import csv
from env_helper import GITHUB_REPOSITORY from env_helper import GITHUB_REPOSITORY, GITHUB_RUN_URL
from ci_config import CI_CONFIG from ci_config import CI_CONFIG
RETRY = 5 RETRY = 5
@ -73,3 +73,15 @@ def post_labels(gh, pr_info, labels_names):
pull_request = repo.get_pull(pr_info.number) pull_request = repo.get_pull(pr_info.number)
for label in labels_names: for label in labels_names:
pull_request.add_to_labels(label) pull_request.add_to_labels(label)
def fail_simple_check(gh, pr_info, description)
if SKIP_SIMPLE_CHECK_LABEL in pr_info.labels:
return
commit = get_commit(gh, pr_info.sha)
commit.create_status(
context="Simple Check",
description=description,
state="failure",
target_url=GITHUB_RUN_URL,
)