@@ -16,6 +16,8 @@ const { GITHUB_EVENT_NAME, GITHUB_SHA } = process.env
16
16
17
17
const configPath = resolve ( process . env . GITHUB_WORKSPACE , getInput ( 'configFile' ) )
18
18
19
+ const failOnErrors = resolve ( process . env . GITHUB_WORKSPACE , getInput ( 'failOnErrors' , { required : false } ) )
20
+
19
21
const getCommitDepth = ( ) => {
20
22
const commitDepthString = getInput ( 'commitDepth' )
21
23
if ( ! commitDepthString ?. trim ( ) ) return null
@@ -145,6 +147,12 @@ const showLintResults = async ([from, to]) => {
145
147
146
148
if ( hasOnlyWarnings ( lintedCommits ) ) {
147
149
handleOnlyWarnings ( formattedResults )
150
+ } else if ( formattedResults && ( failOnErrors == false ) ) {
151
+ // https://github.com/actions/toolkit/tree/master/packages/core#exit-codes
152
+ // this would be a good place to implement the setNeutral() when it's eventually implimented.
153
+ // for now it can pass with a check mark.
154
+ console . log ( 'Passing despite errors ✅' )
155
+ console . log ( `You have commit messages with errors\n\n${ formattedResults } ` )
148
156
} else if ( formattedResults ) {
149
157
setFailedAction ( formattedResults )
150
158
} else {
@@ -156,6 +164,7 @@ const exitWithMessage = (message) => (error) => {
156
164
setFailedAction ( `${ message } \n${ error . message } \n${ error . stack } ` )
157
165
}
158
166
167
+
159
168
const commitLinterAction = ( ) =>
160
169
getRangeForEvent ( )
161
170
. catch (
0 commit comments