github-actions

Is it possible to send workflow log to web server in real time?


I cannot find any docs to handle this case, all I know is GitHub webhook but it seems to be for event notifications. I have a Spring Boot server, when workflow was triggered I need to send detailed logs to my server in real time (I think websocket can do that).


Solution

  • This isn't supported by GitHub Actions itself. Though there probably is an API you could call to get the data, since the website is able to live-view the log. That API isn't officially supported and is undocumented.

    Simplest solution I can think of is to run something on the runner machine that monitors the log folder of the agent and streams that out in realtime. Either installed permanently on a self-hosted runner or installed very early on in the workflow of the hosted-runner.

    Or to call the download logs API when the workflow run is finished.