Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
compnerd opened this issue May 9, 2021 · 3 comments
Open

Comments

@compnerd
Copy link
Contributor

compnerd commented May 9, 2021

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
Copy link
Contributor Author

compnerd commented May 9, 2021

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
Copy link
Contributor Author

compnerd commented May 9, 2021

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

@github-actions
Copy link
Contributor

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 github-actions bot added the stale label May 27, 2021
@github-actions github-actions bot closed this as completed Jun 1, 2021
@ocean90 ocean90 added in progress and removed stale labels Jun 1, 2021
@ocean90 ocean90 reopened this Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants