summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Morph2023-01-29 19:19:24 -0500
committerGravatar Morph2023-01-29 19:53:14 -0500
commit8532e172433ba7d3501cd17352946e6e5c4b9d21 (patch)
tree1572ebdc7aa2a9b44d627358f2f298b947df3f26
parentMerge pull request #9705 from behunin/patch-1 (diff)
downloadyuzu-8532e172433ba7d3501cd17352946e6e5c4b9d21.tar.gz
yuzu-8532e172433ba7d3501cd17352946e6e5c4b9d21.tar.xz
yuzu-8532e172433ba7d3501cd17352946e6e5c4b9d21.zip
ci: Abort on failure to query Github's API
This raises an exception if the GET request to Github's API returns anything other than 200 OK, ensuring we always have successful merges of tagged PRs. Also, reduces the number of queried pages from 29 to 9 to reduce the number of requests.
-rw-r--r--.ci/scripts/merge/apply-patches-by-label.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/.ci/scripts/merge/apply-patches-by-label.py b/.ci/scripts/merge/apply-patches-by-label.py
index 8ddc8ff34..3c5952aa1 100644
--- a/.ci/scripts/merge/apply-patches-by-label.py
+++ b/.ci/scripts/merge/apply-patches-by-label.py
@@ -20,6 +20,7 @@ def check_individual(labels):
20def do_page(page): 20def do_page(page):
21 url = 'https://api.github.com/repos/yuzu-emu/yuzu/pulls?page=%s' % page 21 url = 'https://api.github.com/repos/yuzu-emu/yuzu/pulls?page=%s' % page
22 response = requests.get(url) 22 response = requests.get(url)
23 response.raise_for_status()
23 if (response.ok): 24 if (response.ok):
24 j = json.loads(response.content) 25 j = json.loads(response.content)
25 if j == []: 26 if j == []:
@@ -33,7 +34,7 @@ def do_page(page):
33 print(subprocess.check_output(["git", "commit", "-m\"Merge %s PR %s\"" % (tagline, pn)])) 34 print(subprocess.check_output(["git", "commit", "-m\"Merge %s PR %s\"" % (tagline, pn)]))
34 35
35try: 36try:
36 for i in range(1,30): 37 for i in range(1,10):
37 do_page(i) 38 do_page(i)
38except: 39except:
39 traceback.print_exc(file=sys.stdout) 40 traceback.print_exc(file=sys.stdout)