Skip to content

Commit 0df350c

Browse files
committed
feat(prow): use request review for assign/unassign
Updated the prow script to support request review for assign and unassign commands. Changed the API endpoint to requested_reviewers and adjusted the HTTP method accordingly. Signed-off-by: Chmouel Boudjnah <[email protected]>
1 parent 094744d commit 0df350c

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

.tekton/prow.yaml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,12 @@ spec:
6464
print(f"❌ API request failed: {e}", file=sys.stderr)
6565
sys.exit(1)
6666
67-
if command == "assign":
68-
API_URL = f"{API_BASE}/assignees"
67+
if command == "assign" or command == "unassign":
68+
method = "POST" if command == "assign" else "DELETE"
69+
API_URL = f"{API_BASE.replace('issues', 'pulls')}/requested_reviewers"
6970
values = [value.lstrip('@') for value in values]
70-
data = {"assignees": values}
71-
response = make_request("POST", API_URL, data)
72-
elif command == "unassign":
73-
API_URL = f"{API_BASE}/assignees"
74-
values = [value.lstrip('@') for value in values]
75-
data = {"assignees": values}
76-
response = make_request("DELETE", API_URL, data)
71+
data = {"reviewers": values}
72+
response = make_request(method, API_URL, data)
7773
elif command == "label":
7874
API_URL = f"{API_BASE}/labels"
7975
data = {"labels": values}

0 commit comments

Comments
 (0)