How to exit successfully from custom action

I’m working to create an action which I plan to publish to the GitHub Marketplace that will serve static files on a localhost port for use by future steps within a job. The way this would be incorporated into a workflow would be like this (high-level steps):

  1. Generate files to be served
  2. Use serve-static-action to serve the files on a specific port
  3. Access files on that port

When I run my action, it never exits successfully. You can see where it’s hanging here.

I assume the issue is that the server.listen(portNum) line never returns so my workflow just hangs on that line. How can I have my action complete (successfully) and allow for my the server I create in my action to listen for requests from future steps in the job?