Skip to content

Instantly share code, notes, and snippets.

@Hexcles
Created January 24, 2020 19:56
Show Gist options
  • Save Hexcles/20def95bd19864e8644a2a85c2dd791b to your computer and use it in GitHub Desktop.
Save Hexcles/20def95bd19864e8644a2a85c2dd791b to your computer and use it in GitHub Desktop.
WPT PR Recovery
#!/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")
@Hexcles
Copy link
Author

Hexcles commented Jan 24, 2020

For the record, pr-list is https://paste.mozilla.org/iZEOZi3A/raw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment