@@ -2352,6 +2352,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
23522352Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
23532353const core = __importStar ( __webpack_require__ ( 470 ) ) ;
23542354const child_process_1 = __webpack_require__ ( 129 ) ;
2355+ const fs = __importStar ( __webpack_require__ ( 747 ) ) ;
2356+ const path = __importStar ( __webpack_require__ ( 622 ) ) ;
23552357const util_1 = __webpack_require__ ( 669 ) ;
23562358const cache_1 = __webpack_require__ ( 722 ) ;
23572359const install_1 = __webpack_require__ ( 655 ) ;
@@ -2396,11 +2398,19 @@ function runLint(lintPath) {
23962398 if ( args . includes ( `-out-format` ) ) {
23972399 throw new Error ( `please, don't change out-format for golangci-lint: it can be broken in a future` ) ;
23982400 }
2401+ const workingDirectory = core . getInput ( `working-directory` ) ;
2402+ const cmdArgs = { } ;
2403+ if ( workingDirectory != `` ) {
2404+ if ( ! fs . existsSync ( workingDirectory ) || ! fs . lstatSync ( workingDirectory ) . isDirectory ( ) ) {
2405+ throw new Error ( `working-directory (${ workingDirectory } ) was not a path` ) ;
2406+ }
2407+ cmdArgs . cwd = path . resolve ( workingDirectory ) ;
2408+ }
23992409 const cmd = `${ lintPath } run --out-format=github-actions ${ args } ` . trimRight ( ) ;
2400- core . info ( `Running [${ cmd } ] ...` ) ;
2410+ core . info ( `Running [${ cmd } ] in [ ${ cmdArgs . cwd } ] ...` ) ;
24012411 const startedAt = Date . now ( ) ;
24022412 try {
2403- const res = yield execShellCommand ( cmd ) ;
2413+ const res = yield execShellCommand ( cmd , cmdArgs ) ;
24042414 printOutput ( res ) ;
24052415 core . info ( `golangci-lint found no issues` ) ;
24062416 }
0 commit comments