def gh_api()

in stash/restore/get_stash.py [0:0]


def gh_api(endpoint: str, method: str = "get", options: List[str] = []):
    """Wrapper to run `gh` REST API calls."""
    args = [
        "gh",
        "api",
        "-H",
        "Accept: application/vnd.github+json",
        "-H",
        "X-GitHub-Api-Version: 2022-11-28",
        f"--method={method}",
        *options,
        endpoint,
    ]
    result = run_checked(args)
    return result