From 8436439b0bedd56afcc2e8245e4d386a28cf2807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9on=20Avic=20Simmons?= Date: Mon, 29 Jun 2026 12:05:23 -0400 Subject: [PATCH] fix: correct type hints and undefined variable in utils - network.py: use `Any` (typing) instead of `any` (builtin) in check_response signature - roles.py: fix undefined `organization` variable to use `org` parameter in create_role() - export.py: add missing `from typing import Dict` import used in function signature --- src/ghas_cli/utils/export.py | 1 + src/ghas_cli/utils/network.py | 2 +- src/ghas_cli/utils/roles.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ghas_cli/utils/export.py b/src/ghas_cli/utils/export.py index ccb0298..f8cc37c 100644 --- a/src/ghas_cli/utils/export.py +++ b/src/ghas_cli/utils/export.py @@ -3,6 +3,7 @@ import json import logging +from typing import Dict def output_to_csv(alerts_per_repos: Dict, location: str) -> bool: diff --git a/src/ghas_cli/utils/network.py b/src/ghas_cli/utils/network.py index 06e726a..2318537 100644 --- a/src/ghas_cli/utils/network.py +++ b/src/ghas_cli/utils/network.py @@ -57,7 +57,7 @@ def check_unauthorized(response: Any): return True -def check_response(response: any): +def check_response(response: Any): check_rate_limit(response) check_unauthorized(response) diff --git a/src/ghas_cli/utils/roles.py b/src/ghas_cli/utils/roles.py index d981039..32b8618 100644 --- a/src/ghas_cli/utils/roles.py +++ b/src/ghas_cli/utils/roles.py @@ -24,7 +24,7 @@ def create_role( } role_resp = requests.post( - url=f"https://api.github.com/orgs/{organization}/custom_roles", + url=f"https://api.github.com/orgs/{org}/custom_roles", headers=headers, json=payload, )