mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Remove submodule changed
This commit is contained in:
parent
999558f00f
commit
1a8b2c9637
@ -61,6 +61,13 @@ def post_commit_status_to_file(file_path, description, state, report_url):
|
|||||||
out.writerow([state, report_url, description])
|
out.writerow([state, report_url, description])
|
||||||
|
|
||||||
|
|
||||||
|
def remove_labels(gh, pr_info, labels_names):
|
||||||
|
repo = gh.get_repo(GITHUB_REPOSITORY)
|
||||||
|
pull_request = repo.get_pull(pr_info.number)
|
||||||
|
for label in labels_names:
|
||||||
|
pull_request.remove_from_labels(label)
|
||||||
|
|
||||||
|
|
||||||
def post_labels(gh, pr_info, labels_names):
|
def post_labels(gh, pr_info, labels_names):
|
||||||
repo = gh.get_repo(GITHUB_REPOSITORY)
|
repo = gh.get_repo(GITHUB_REPOSITORY)
|
||||||
pull_request = repo.get_pull(pr_info.number)
|
pull_request = repo.get_pull(pr_info.number)
|
||||||
|
@ -8,7 +8,7 @@ from github import Github
|
|||||||
from env_helper import GITHUB_RUN_URL, GITHUB_REPOSITORY, GITHUB_SERVER_URL
|
from env_helper import GITHUB_RUN_URL, GITHUB_REPOSITORY, GITHUB_SERVER_URL
|
||||||
from pr_info import PRInfo
|
from pr_info import PRInfo
|
||||||
from get_robot_token import get_best_robot_token
|
from get_robot_token import get_best_robot_token
|
||||||
from commit_status_helper import get_commit, post_labels
|
from commit_status_helper import get_commit, post_labels, remove_labels
|
||||||
|
|
||||||
NAME = "Run Check (actions)"
|
NAME = "Run Check (actions)"
|
||||||
|
|
||||||
@ -235,13 +235,19 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
description_report, category = check_pr_description(pr_info)
|
description_report, category = check_pr_description(pr_info)
|
||||||
pr_labels = []
|
pr_labels = []
|
||||||
if category in MAP_CATEGORY_TO_LABEL:
|
if (
|
||||||
|
category in MAP_CATEGORY_TO_LABEL
|
||||||
|
and MAP_CATEGORY_TO_LABEL[category] not in pr_info.labels
|
||||||
|
):
|
||||||
pr_labels.append(MAP_CATEGORY_TO_LABEL[category])
|
pr_labels.append(MAP_CATEGORY_TO_LABEL[category])
|
||||||
|
|
||||||
if pr_info.has_changes_in_submodules():
|
if pr_info.has_changes_in_submodules():
|
||||||
pr_labels.append(SUBMODULE_CHANGED_LABEL)
|
pr_labels.append(SUBMODULE_CHANGED_LABEL)
|
||||||
|
elif SUBMODULE_CHANGED_LABEL in pr_info.labels:
|
||||||
|
remove_labels(gh, pr_info, [SUBMODULE_CHANGED_LABEL])
|
||||||
|
|
||||||
post_labels(gh, pr_info, pr_labels)
|
if pr_labels:
|
||||||
|
post_labels(gh, pr_info, pr_labels)
|
||||||
if description_report:
|
if description_report:
|
||||||
print("::notice ::Cannot run, description does not match the template")
|
print("::notice ::Cannot run, description does not match the template")
|
||||||
logging.info(
|
logging.info(
|
||||||
|
Loading…
Reference in New Issue
Block a user