@@ -8,18 +8,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
step ( ( generator = generator . apply ( thisArg , _arguments || [ ] ) ) . next ( ) ) ;
9
9
} ) ;
10
10
} ;
11
+ var __importDefault = ( this && this . __importDefault ) || function ( mod ) {
12
+ return ( mod && mod . __esModule ) ? mod : { "default" : mod } ;
13
+ } ;
11
14
var __importStar = ( this && this . __importStar ) || function ( mod ) {
12
15
if ( mod && mod . __esModule ) return mod ;
13
16
var result = { } ;
14
17
if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
15
18
result [ "default" ] = mod ;
16
19
return result ;
17
20
} ;
18
- var __importDefault = ( this && this . __importDefault ) || function ( mod ) {
19
- return ( mod && mod . __esModule ) ? mod : { "default" : mod } ;
20
- } ;
21
21
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
22
22
/* eslint-disable @typescript-eslint/camelcase */
23
+ const path_1 = __importDefault ( require ( "path" ) ) ;
23
24
const core = __importStar ( require ( "@actions/core" ) ) ;
24
25
const github = __importStar ( require ( "@actions/github" ) ) ;
25
26
const eslint_1 = __importDefault ( require ( "eslint" ) ) ;
@@ -51,9 +52,18 @@ const processArrayInput = (key, required = false) => {
51
52
function lint ( files ) {
52
53
const extensions = processArrayInput ( 'extensions' , true ) ;
53
54
const ignoreGlob = processArrayInput ( 'ignore' ) ;
55
+ let cwd = core . getInput ( 'working-directory' ) ;
56
+ if ( cwd && ! path_1 . default . isAbsolute ( cwd ) ) {
57
+ cwd = path_1 . default . resolve ( cwd ) ;
58
+ }
59
+ else if ( ! cwd ) {
60
+ cwd = process . cwd ( ) ;
61
+ }
62
+ core . debug ( `Starting lint engine with cwd: ${ cwd } ` ) ;
54
63
const linter = new eslint_1 . default . CLIEngine ( {
55
64
extensions,
56
65
ignorePattern : ignoreGlob ,
66
+ cwd,
57
67
} ) ;
58
68
return linter . executeOnFiles ( files ) ;
59
69
}
0 commit comments