lint-action icon indicating copy to clipboard operation
lint-action copied to clipboard

Action fails to report lint results on Windows (swift-format-official)

Open compnerd opened this issue 3 years ago • 3 comments

When using this action on Windows, the lint action always succeeds, silently discarding the results. This was observed with the swift-format-official usage, but is likely the case for other tooling as well.

compnerd avatar May 09 '21 21:05 compnerd

The underling issue here is that run will use execSync which will invoke the tool in a subshell. However, the result of the subshell will not be propagated back due to being invoked in a sub-%COMSPEC% environment (https://nodejs.org/api/child_process.html#child_process_child_process_execsync_command_options).

The solution here is to perform a micro-optimization which will incidentally fix the issue - namely moving away from child_process.execSync. Using child_process.spawnSync is better as it can avoid the shell entire (we can still retain the ability to run a shell if needed, but I suspect it is not necessary). This avoids the need to create a new shell environment and run the subprocess.

compnerd avatar May 09 '21 21:05 compnerd

#218 should be able to demonstrate the test failures at least and hopefully prevent future regressions.

compnerd avatar May 09 '21 23:05 compnerd

A stale label has been added to this issue because it has been open 15 days with no activity. To keep this issue open, add a comment within 5 days.

github-actions[bot] avatar May 27 '21 03:05 github-actions[bot]