Skip to content

Commit

Permalink
Update logs
Browse files Browse the repository at this point in the history
Signed-off-by: Brett Logan <lindluni@github.com>
  • Loading branch information
lindluni committed Oct 20, 2023
1 parent 483f28a commit 1f00956
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion enforce-ghas-policy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const main = async () => {
}

try {
core.info('Retrieving CodeQL Code Scanning alerts')
core.info(`Retrieving high severity CodeQL Code Scanning alerts for ${org}/${repo}/${ref}`)
const highAlerts = await client.paginate(client.codeScanning.listAlertsForRepo, {
owner: org,
repo: repo,
Expand All @@ -70,6 +70,8 @@ const main = async () => {
state: 'open',
tool_name: 'CodeQL',
})

core.info(`Retrieving critical severity CodeQL Code Scanning alerts for ${org}/${repo}/${ref}`)
const criticalAlerts = await client.paginate(client.codeScanning.listAlertsForRepo, {
owner: org,
repo: repo,
Expand All @@ -78,6 +80,8 @@ const main = async () => {
state: 'open',
tool_name: 'CodeQL',
})
core.info(`Found ${highAlerts.length} high and ${criticalAlerts.length} critical alerts`)

if (highAlerts.length > 0 || criticalAlerts.length > 0) {
core.info(`Found ${highAlerts.length} high and ${criticalAlerts.length} critical alerts`)
const message = messageViolation.replace('{highAlerts}', String(highAlerts.length)).replace('{criticalAlerts}', String(criticalAlerts.length))
Expand Down

0 comments on commit 1f00956

Please sign in to comment.