Closed AlexanderHarley closed 2 years ago
Wow, good catch! Thanks for this.
Wow! Thanks @AlexanderHarley. I'm surprised we haven't run into this either.
We should prob look to see if there are other exec
s missing await
s!
@wraithm I did a quick read-through of https://github.com/fourmolu/fourmolu-action/blob/master/index.js, and as far as I can tell we have await
s in all the right places.
When integrating
fourmolu-action
into one of our workflows I encountered a similar issue to #4, where an exception would cause thefourmolu detected unformatted files
error to appear without any output from thefourmolu
executable.I noticed after removing the
silent: true
parameter from thechmod
execution that the call tochmod +x
seemed to be happening after the call to executefourmolu
. Logging the error also seemed to indicate thatfourmolu
didn't have executable mode at the time it was called:This led me to notice the
exec
call tochmod
is missing anawait
. Asexec
is anasync
function, adding theawait
seems to have resolved the issue wherefourmolu
is being executed before being given executable mode.One thing I find strange is I'm not sure why this issue appeared for me but not for other workflow runs, such as in this repo as well as those of other users. I notice the
await
is also missing in the originalormolu-action
(https://github.com/mrkkrp/ormolu-action/blob/4b9de76efeefdf7b0791bec94588d076d917ec64/index.js#L51-L53), so I would have thought more users would have experienced this issue, at least intermittently.