From 490cec3e1053053275daf6abb08be7d17783db4f Mon Sep 17 00:00:00 2001 From: Abhilash Issac Date: Thu, 14 Mar 2024 12:37:59 +0530 Subject: [PATCH] capturing the repo details --- src/services/secretscanning.ts | 2 +- src/services/summary.ts | 6 ++++-- src/types/common/main.d.ts | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/services/secretscanning.ts b/src/services/secretscanning.ts index d960ec8..b71b36d 100644 --- a/src/services/secretscanning.ts +++ b/src/services/secretscanning.ts @@ -12,7 +12,7 @@ export async function getSecretScanningAlertsForScope( return res } catch (error: unknown) { if (error instanceof Error) { - core.debug(`Error with fatching alerts from the API.: ${error}`) + core.debug(`Error with fetching alerts from the API.: ${error}`) core.setFailed( 'Error: There was an error fetching the alerts from the API. Please check the logs.' ) diff --git a/src/services/summary.ts b/src/services/summary.ts index 6874922..8ab5aa6 100644 --- a/src/services/summary.ts +++ b/src/services/summary.ts @@ -3,13 +3,15 @@ import {SummaryTableRow} from '@actions/core/lib/summary' import {SecretScanningAlert} from '../types/common/main' export function addToSummary(title: string, alerts: SecretScanningAlert[]) { - const headers = ['Alert Number', 'Secret State', 'Secret Type', 'HTML URL'] + const headers = ['Alert Number', 'Secret State', 'Secret Type', 'HTML URL', 'Repo Owner', 'Repo Name', 'Org Name', 'Org Owner'] // Define the table rows const rows = alerts.map(alert => [ alert.number.toString(), alert.state, alert.secret_type, - alert.html_url + alert.html_url, + alert.login, + alert.name ]) // Add the table to the Action summary diff --git a/src/types/common/main.d.ts b/src/types/common/main.d.ts index eaf7fec..1e1463d 100644 --- a/src/types/common/main.d.ts +++ b/src/types/common/main.d.ts @@ -23,6 +23,8 @@ type SecretScanningAlert = { html_url: string state: string secret_type: string + login: string + name: string } type RateLimitOptions = {