Skip to content

File system error goes uncatched #9

Open
@mbiegert

Description

@mbiegert

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions