5
0
Fork 0
mirror of https://github.com/wagoid/commitlint-github-action.git synced 2025-11-07 16:06:56 +00:00

fix(action): refactor a value, add to docs

This commit is contained in:
Cooper 2023-04-05 12:11:01 -04:00
parent 2640e4c8bf
commit 7991e57b35
No known key found for this signature in database
GPG key ID: DF6ECEF0888ECA4B
2 changed files with 13 additions and 3 deletions

View file

@ -52,6 +52,18 @@ Whether you want to fail on warnings or not.
Default: `false` 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` ### `helpURL`
Link to a page explaining your commit message convention. Link to a page explaining your commit message convention.

View file

@ -16,8 +16,6 @@ const { GITHUB_EVENT_NAME, GITHUB_SHA } = process.env
const configPath = resolve(process.env.GITHUB_WORKSPACE, getInput('configFile')) const configPath = resolve(process.env.GITHUB_WORKSPACE, getInput('configFile'))
const failOnErrors = getInput('failOnErrors')
const getCommitDepth = () => { const getCommitDepth = () => {
const commitDepthString = getInput('commitDepth') const commitDepthString = getInput('commitDepth')
if (!commitDepthString?.trim()) return null if (!commitDepthString?.trim()) return null
@ -147,7 +145,7 @@ const showLintResults = async ([from, to]) => {
if (hasOnlyWarnings(lintedCommits)) { if (hasOnlyWarnings(lintedCommits)) {
handleOnlyWarnings(formattedResults) handleOnlyWarnings(formattedResults)
} else if (formattedResults && failOnErrors === 'false') { } else if (formattedResults && getInput('failOnErrors') === 'false') {
// https://github.com/actions/toolkit/tree/master/packages/core#exit-codes // 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. // this would be a good place to implement the setNeutral() when it's eventually implimented.
// for now it can pass with a check mark. // for now it can pass with a check mark.