mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
Merge pull request #51405 from ClickHouse/status-lambdas
Fix broken labeling for `manual approve`
This commit is contained in:
commit
32e671d0c6
@ -224,8 +224,8 @@ def approve_run(workflow_description: WorkflowDescription, token: str) -> None:
|
||||
|
||||
|
||||
def label_manual_approve(pull_request, token):
|
||||
url = f"{pull_request['url']}/labels"
|
||||
data = {"labels": "manual approve"}
|
||||
url = f"{pull_request['issue_url']}/labels"
|
||||
data = {"labels": ["manual approve"]}
|
||||
|
||||
_exec_post_with_retry(url, token, data)
|
||||
|
||||
@ -376,11 +376,10 @@ def main(event):
|
||||
changed_files = get_changed_files_for_pull_request(pull_request, token)
|
||||
print(f"Totally have {len(changed_files)} changed files in PR:", changed_files)
|
||||
if check_suspicious_changed_files(changed_files):
|
||||
print(
|
||||
f"Pull Request {pull_request['number']} has suspicious changes, "
|
||||
"label it for manuall approve"
|
||||
)
|
||||
label_manual_approve(pull_request, token)
|
||||
print(f"Pull Request {pull_request['number']} has suspicious changes")
|
||||
if "manual approve" not in labels:
|
||||
print("Label the PR as needed for manuall approve")
|
||||
label_manual_approve(pull_request, token)
|
||||
else:
|
||||
print(f"Pull Request {pull_request['number']} has no suspicious changes")
|
||||
approve_run(workflow_description, token)
|
||||
|
Loading…
Reference in New Issue
Block a user