1
0
mirror of https://github.com/lutris/lutris synced 2024-07-02 23:18:43 +00:00
lutris/utils/issuelocker.py

22 lines
570 B
Python
Raw Normal View History

2024-02-27 01:53:56 +00:00
#!/usr/bin/env python
import json
import os
import subprocess
PROJECT_ROOT = os.path.expanduser("~/Projects/lutris")
2024-02-27 06:56:10 +00:00
OWNER = "lutris"
REPO = "lutris"
2024-02-27 01:53:56 +00:00
response = subprocess.check_output(
"gh issue list -L 200 --state closed --json number --search 'is:unlocked'",
shell=True,
cwd=PROJECT_ROOT,
)
issues = json.loads(response)
for issue in issues:
2024-02-28 18:18:32 +00:00
print(f"Locking issue {issue['number']}")
2024-02-27 01:53:56 +00:00
subprocess.check_output(
2024-02-28 18:18:32 +00:00
f"gh api --method PUT /repos/{OWNER}/{REPO}/issues/{issue['number']}/lock -f lock_reason='resolved'",
2024-02-27 01:53:56 +00:00
shell=True,
)