Skip to content

Commit 7991e57

Browse files
committed
fix(action): refactor a value, add to docs
1 parent 2640e4c commit 7991e57

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ Whether you want to fail on warnings or not.
5252

5353
Default: `false`
5454

55+
### `failOnWarnings`
56+
57+
Whether you want to fail on warnings or not.
58+
59+
Default: `false`
60+
61+
### `failOnErrors`
62+
63+
Whether you want to fail on errors or not. Still outputs the results, just forces the action to pass even if errors are detected.
64+
65+
Default: `true`
66+
5567
### `helpURL`
5668

5769
Link to a page explaining your commit message convention.

src/action.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ const { GITHUB_EVENT_NAME, GITHUB_SHA } = process.env
1616

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

19-
const failOnErrors = getInput('failOnErrors')
20-
2119
const getCommitDepth = () => {
2220
const commitDepthString = getInput('commitDepth')
2321
if (!commitDepthString?.trim()) return null
@@ -147,7 +145,7 @@ const showLintResults = async ([from, to]) => {
147145

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

0 commit comments

Comments
 (0)