From 6d77dbd63baefcb48c4b70db7f09b33af65f8e4c Mon Sep 17 00:00:00 2001 From: user Date: Wed, 20 Dec 2023 05:43:24 -0500 Subject: [PATCH] added endpoint --- scripts/review_bot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/review_bot.py b/scripts/review_bot.py index f244fe5f7d0ac7..6d551d45eb5228 100755 --- a/scripts/review_bot.py +++ b/scripts/review_bot.py @@ -7,6 +7,7 @@ from github import Github BOT_REVIEW_LABEL = "bot-review" +GRAPHQL_ENDPOINT = "https://api.github.com/graphql" # Read the pr event file, which is passed in as first arg def read_pr_event(): @@ -44,7 +45,7 @@ def get_pull_request_graphql_id(accessToken,name,number): }} }} }}""" - r = requests.post(endpoint, json={"query": query}, headers=headers) + r = requests.post(GRAPHQL_ENDPOINT, json={"query": query}, headers=headers) return r.json()["data"]["repository"]["pullRequest"]["id"] # use GraphQL to set pull request as draft @@ -57,7 +58,7 @@ def set_pr_draft(accessToken,id): }} }} }}""" - requests.post(endpoint, json={"query": query}, headers=headers) + requests.post(GRAPHQL_ENDPOINT, json={"query": query}, headers=headers) # use GraphQL to set pull request as ready def set_pr_ready(accessToken,id): @@ -69,7 +70,7 @@ def set_pr_ready(accessToken,id): }} }} }}""" - requests.post(endpoint, json={"query": query}, headers=headers) + requests.post(GRAPHQL_ENDPOINT, json={"query": query}, headers=headers) if __name__ == "__main__": accessToken = os.environ['GITHUB_TOKEN']