base64-to-file icon indicating copy to clipboard operation
base64-to-file copied to clipboard

File system error goes uncatched

Open mbiegert opened this issue 4 years ago • 0 comments

Hi, I just stumbled across this nice action and had a look at the code. I noticed that filesystem errors will bubble up to the caller of the action. (Not sure how github actions handles that.) But the try catch block is effectively useless to catch fs errors. (catches Buffer errors, though)

I suggest to use the synchronous way of the node fs api. Or wrap the fs.writeFile call in a promise that we can await on as the run function is marked async.

So in short: Fs errors will not reach the catch block, so core.setFailed won't be called. Maybe the github actions runner will do the same automatically when the action throws, but I am not sure.

mbiegert avatar Jul 17 '20 11:07 mbiegert