diff options
Diffstat (limited to '.ci/scripts/merge/apply-patches-by-label.py')
| -rw-r--r-- | .ci/scripts/merge/apply-patches-by-label.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/.ci/scripts/merge/apply-patches-by-label.py b/.ci/scripts/merge/apply-patches-by-label.py index 7f1ea06cf..43ed74d7f 100644 --- a/.ci/scripts/merge/apply-patches-by-label.py +++ b/.ci/scripts/merge/apply-patches-by-label.py | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | import requests, sys, json, urllib3.request, shutil, subprocess, os | 4 | import requests, sys, json, urllib3.request, shutil, subprocess, os |
| 5 | 5 | ||
| 6 | tagline = os.getenv("MergeTaglinePublic".upper(), "") | 6 | tagline = sys.argv[2] |
| 7 | 7 | ||
| 8 | http = urllib3.PoolManager() | 8 | http = urllib3.PoolManager() |
| 9 | dl_list = {} | 9 | dl_list = {} |
| @@ -14,11 +14,13 @@ def check_individual(labels): | |||
| 14 | return True | 14 | return True |
| 15 | return False | 15 | return False |
| 16 | 16 | ||
| 17 | try: | 17 | def do_page(page): |
| 18 | url = 'https://api.github.com/repos/yuzu-emu/yuzu/pulls' | 18 | url = 'https://api.github.com/repos/yuzu-emu/yuzu/pulls?page=%s' % page |
| 19 | response = requests.get(url) | 19 | response = requests.get(url) |
| 20 | if (response.ok): | 20 | if (response.ok): |
| 21 | j = json.loads(response.content) | 21 | j = json.loads(response.content) |
| 22 | if j == []: | ||
| 23 | return | ||
| 22 | for pr in j: | 24 | for pr in j: |
| 23 | if (check_individual(pr["labels"])): | 25 | if (check_individual(pr["labels"])): |
| 24 | pn = pr["number"] | 26 | pn = pr["number"] |
| @@ -26,5 +28,9 @@ try: | |||
| 26 | print(subprocess.check_output(["git", "fetch", "https://github.com/yuzu-emu/yuzu.git", "pull/%s/head:pr-%s" % (pn, pn), "-f"])) | 28 | print(subprocess.check_output(["git", "fetch", "https://github.com/yuzu-emu/yuzu.git", "pull/%s/head:pr-%s" % (pn, pn), "-f"])) |
| 27 | print(subprocess.check_output(["git", "merge", "--squash", "pr-%s" % pn])) | 29 | print(subprocess.check_output(["git", "merge", "--squash", "pr-%s" % pn])) |
| 28 | print(subprocess.check_output(["git", "commit", "-m\"Merge %s PR %s\"" % (tagline, pn)])) | 30 | print(subprocess.check_output(["git", "commit", "-m\"Merge %s PR %s\"" % (tagline, pn)])) |
| 31 | |||
| 32 | try: | ||
| 33 | for i in range(1,30): | ||
| 34 | do_page(i) | ||
| 29 | except: | 35 | except: |
| 30 | sys.exit(-1) | 36 | sys.exit(-1) |