From 17d8436acf44c1a47dff83bd3792f33afb06686e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 10 Oct 2023 15:42:27 +0200 Subject: [PATCH] Change: Improve secret scanning API usage examples --- pontos/github/api/secret_scanning.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pontos/github/api/secret_scanning.py b/pontos/github/api/secret_scanning.py index d6498c90e..4186c14df 100644 --- a/pontos/github/api/secret_scanning.py +++ b/pontos/github/api/secret_scanning.py @@ -147,7 +147,7 @@ async def organization_alerts( async with GitHubAsyncRESTApi(token) as api: async for alert in api.secret_scanning.organization_alerts( - "my-enterprise" + "my-org" ): print(alert) """ @@ -202,7 +202,7 @@ async def alerts( async with GitHubAsyncRESTApi(token) as api: async for alert in api.secret_scanning.alerts( - "my-enterprise" + "my-org/my-repo" ): print(alert) """ @@ -288,12 +288,18 @@ async def update_alert( .. code-block:: python from pontos.github.api import GitHubAsyncRESTApi + from pontos.github.models.secret_scanning import ( + AlertState, + Resolution, + ) async with GitHubAsyncRESTApi(token) as api: - alert = await api.dependabot.update( + alert = await api.secret_scanning.update_alert( "foo/bar", 123, AlertState.RESOLVED, + resolution=Resolution.WONT_FIX, + resolution_comment="Not applicable", ) """ api = f"/repos/{repo}/secret-scanning/alerts/{alert_number}"