File tree 3 files changed +12
-1
lines changed
3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ inputs:
17
17
standard :
18
18
description : ' Code style standard name (PEAR, ) or path to a phpcs.xml file'
19
19
required : false
20
+ fail_on_errors :
21
+ description : ' Whether action should fail on errors or not, default to true (fails)'
22
+ required : false
20
23
fail_on_warnings :
21
24
description : ' Whether action should fail on warnings or not, default to true (fails)'
22
25
required : false
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ export async function runOnBlame(files: string[]): Promise<void> {
17
17
core . getInput ( 'phpcs_path' , { required : true } )
18
18
) ;
19
19
20
+ const dontFailOnError =
21
+ core . getInput ( 'fail_on_errors' ) == 'false' ||
22
+ core . getInput ( 'fail_on_errors' ) === 'off' ;
20
23
const dontFailOnWarning =
21
24
core . getInput ( 'fail_on_warnings' ) == 'false' ||
22
25
core . getInput ( 'fail_on_warnings' ) === 'off' ;
@@ -58,7 +61,8 @@ export async function runOnBlame(files: string[]): Promise<void> {
58
61
// fail
59
62
if ( message . type === 'WARNING' && ! dontFailOnWarning )
60
63
core . setFailed ( message . message ) ;
61
- else if ( message . type === 'ERROR' ) core . setFailed ( message . message ) ;
64
+ else if ( message . type === 'ERROR' && ! dontFailOnError )
65
+ core . setFailed ( message . message ) ;
62
66
}
63
67
}
64
68
}
Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ export function runOnCompleteFiles(files: string[]): number {
12
12
const standard = core . getInput ( 'standard' ) ;
13
13
if ( standard ) args . push ( `--standard=${ standard } ` ) ;
14
14
15
+ const failOnError = core . getInput ( 'fail_on_errors' ) ;
16
+ if ( failOnError == 'false' || failOnError === 'off' ) {
17
+ args . push ( '--runtime-set ignore_errors_on_exit 1' ) ;
18
+ }
15
19
const failOnWarning = core . getInput ( 'fail_on_warnings' ) ;
16
20
if ( failOnWarning == 'false' || failOnWarning === 'off' ) {
17
21
args . push ( '--runtime-set ignore_warnings_on_exit 1' ) ;
You can’t perform that action at this time.
0 commit comments