Update pr_info.labels in commit_helper lebel helpers

This commit is contained in:
Mikhail f. Shiryaev 2023-04-24 11:03:25 +02:00
parent caee710fcc
commit 222176639d
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4
2 changed files with 3 additions and 1 deletions

View File

@ -95,6 +95,7 @@ def remove_labels(gh: Github, pr_info: PRInfo, labels_names: List[str]) -> None:
pull_request = repo.get_pull(pr_info.number)
for label in labels_names:
pull_request.remove_from_labels(label)
pr_info.labels.remove(label)
def post_labels(gh: Github, pr_info: PRInfo, labels_names: List[str]) -> None:
@ -102,6 +103,7 @@ def post_labels(gh: Github, pr_info: PRInfo, labels_names: List[str]) -> None:
pull_request = repo.get_pull(pr_info.number)
for label in labels_names:
pull_request.add_to_labels(label)
pr_info.labels.add(label)
def format_description(description: str) -> str:

View File

@ -251,7 +251,7 @@ if __name__ == "__main__":
if pr_labels_to_remove:
remove_labels(gh, pr_info, pr_labels_to_remove)
if FEATURE_LABEL in pr_labels_to_add:
if FEATURE_LABEL in pr_info.labels:
print(f"The '{FEATURE_LABEL}' in the labels, expect the 'Docs Check' status")
commit.create_status(
context=DOCS_NAME,