Skip to content

Commit

Permalink
fix(action): refactor a value, add to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cmitzel-ncino committed Apr 5, 2023
1 parent 2640e4c commit 7991e57
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ Whether you want to fail on warnings or not.

Default: `false`

### `failOnWarnings`

Whether you want to fail on warnings or not.

Default: `false`

### `failOnErrors`

Whether you want to fail on errors or not. Still outputs the results, just forces the action to pass even if errors are detected.

Default: `true`

### `helpURL`

Link to a page explaining your commit message convention.
Expand Down
4 changes: 1 addition & 3 deletions src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ const { GITHUB_EVENT_NAME, GITHUB_SHA } = process.env

const configPath = resolve(process.env.GITHUB_WORKSPACE, getInput('configFile'))

const failOnErrors = getInput('failOnErrors')

const getCommitDepth = () => {
const commitDepthString = getInput('commitDepth')
if (!commitDepthString?.trim()) return null
Expand Down Expand Up @@ -147,7 +145,7 @@ const showLintResults = async ([from, to]) => {

if (hasOnlyWarnings(lintedCommits)) {
handleOnlyWarnings(formattedResults)
} else if (formattedResults && failOnErrors === 'false') {
} else if (formattedResults && getInput('failOnErrors') === 'false') {
// https://github.com/actions/toolkit/tree/master/packages/core#exit-codes
// this would be a good place to implement the setNeutral() when it's eventually implimented.
// for now it can pass with a check mark.
Expand Down

0 comments on commit 7991e57

Please sign in to comment.