Created
January 24, 2020 19:56
-
-
Save Hexcles/20def95bd19864e8644a2a85c2dd791b to your computer and use it in GitHub Desktop.
WPT PR Recovery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import json | |
import requests | |
with open("github-credentials.json", "r") as f: | |
creds = json.load(f) | |
prs = open("pr-list", "r") | |
with open("pr-errors", "w") as err: | |
for line in prs: | |
pr = line.strip() | |
url = "https://api.github.com/repos/web-platform-tests/wpt/pulls/" + pr | |
r = requests.patch(url, | |
json={"state": "open"}, | |
auth=(creds['user'], creds['token'])) | |
if r.status_code == 200: | |
print("SUCCESS: %s" % pr) | |
else: | |
print("ERROR[%d]: %s" % (r.status_code, pr)) | |
err.write(pr + "\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For the record,
pr-list
is https://paste.mozilla.org/iZEOZi3A/raw