(endpoint, jq=None)
| 21 | |
| 22 | |
| 23 | def gh_api(endpoint, jq=None): |
| 24 | cmd = ["gh", "api", endpoint] |
| 25 | if jq: |
| 26 | cmd += ["--jq", jq] |
| 27 | try: |
| 28 | result = subprocess.run(cmd, capture_output=True, text=True, timeout=10) |
| 29 | return result.stdout.strip() if result.returncode == 0 else "" |
| 30 | except (subprocess.TimeoutExpired, FileNotFoundError): |
| 31 | return "" |
| 32 | |
| 33 | |
| 34 | def get_pr_number(commit_hash): |
no test coverage detected