File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ inputs:
1717 standard :
1818 description : ' Code style standard name (PEAR, ) or path to a phpcs.xml file'
1919 required : false
20+ fail_on_errors :
21+ description : ' Whether action should fail on errors or not, default to true (fails)'
22+ required : false
2023 fail_on_warnings :
2124 description : ' Whether action should fail on warnings or not, default to true (fails)'
2225 required : false
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ export async function runOnBlame(files: string[]): Promise<void> {
1717 core . getInput ( 'phpcs_path' , { required : true } )
1818 ) ;
1919
20+ const dontFailOnError =
21+ core . getInput ( 'fail_on_errors' ) == 'false' ||
22+ core . getInput ( 'fail_on_errors' ) === 'off' ;
2023 const dontFailOnWarning =
2124 core . getInput ( 'fail_on_warnings' ) == 'false' ||
2225 core . getInput ( 'fail_on_warnings' ) === 'off' ;
@@ -56,7 +59,8 @@ export async function runOnBlame(files: string[]): Promise<void> {
5659 // fail
5760 if ( message . type === 'WARNING' && ! dontFailOnWarning )
5861 core . setFailed ( message . message ) ;
59- else if ( message . type === 'ERROR' ) core . setFailed ( message . message ) ;
62+ else if ( message . type === 'ERROR' && ! dontFailOnError )
63+ core . setFailed ( message . message ) ;
6064 }
6165 }
6266 }
Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ export function runOnCompleteFiles(files: string[]): number {
1212 const standard = core . getInput ( 'standard' ) ;
1313 if ( standard ) args . push ( `--standard=${ standard } ` ) ;
1414
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+ }
1519 const failOnWarning = core . getInput ( 'fail_on_warnings' ) ;
1620 if ( failOnWarning == 'false' || failOnWarning === 'off' ) {
1721 args . push ( '--runtime-set ignore_warnings_on_exit 1' ) ;
You can’t perform that action at this time.
0 commit comments