Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lcollins authored May 4, 2024
1 parent 8166100 commit 6b2338e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ inputs:
Also when generating a new PAT, select the least scopes necessary.
[Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
default: ${{ github.token }}
fail-on-violation:
description: 'Enables status markers to be added to check'
default: false
required: false
runs:
using: 'node20'
main: 'dist/index.js'
Expand Down
8 changes: 6 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ async function run(): Promise<void> {
const path = core.getInput(Inputs.Path, {required: true})
const name = core.getInput(Inputs.Name)
const title = core.getInput(Inputs.Title)
const failOnViolations = core.getBooleanInput(Inputs.FailOnViolation)
const failOnViolations = core.getBooleanInput(Inputs.FailOnViolation, {
required: false
})

const searchResult = await findResults(path)
if (searchResult.filesToUpload.length === 0) {
Expand Down Expand Up @@ -107,7 +109,12 @@ async function createCheck(
...context.repo,
check_run_id,
status: 'completed' as const,
conclusion: 'neutral' as const,
conclusion:
numErrors === 0
? ('success' as const)
: failOnViolations
? ('failure' as const)
: ('neutral' as const),
output: {
title,
summary: `${numErrors} violation(s) found`,
Expand Down

0 comments on commit 6b2338e

Please sign in to comment.