File: issuelocker.py

package info (click to toggle)
lutris 0.5.19-3
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 7,636 kB
  • sloc: python: 42,264; xml: 151; makefile: 77; sh: 30
file content (21 lines) | stat: -rwxr-xr-x 570 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python
import json
import os
import subprocess

PROJECT_ROOT = os.path.expanduser("~/Projects/lutris")
OWNER = "lutris"
REPO = "lutris"

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:
    print(f"Locking issue {issue['number']}")
    subprocess.check_output(
        f"gh api --method PUT /repos/{OWNER}/{REPO}/issues/{issue['number']}/lock -f lock_reason='resolved'",
        shell=True,
    )