ghactions-manager icon indicating copy to clipboard operation
ghactions-manager copied to clipboard

Job is still in progress, it is not possible to view logs while job is running

Open v0rest opened this issue 3 months ago • 2 comments

Problem: Currently, when a GitHub Actions workflow job is in progress, it's not possible to view the logs in real-time within ghactions-manager. Users must wait until the job completes to see the output, which makes debugging and monitoring long-running jobs difficult. This is frustrating when trying to troubleshoot issues or monitor the progress of workflows that take several minutes or hours to complete.

Solution: I would like the ability to stream and view logs while a job is still running. This can be achieved by polling the GitHub API to fetch logs for in-progress jobs.

The solution would involve:

  1. Checking the workflow run status periodically
  2. Fetching job logs for jobs that are "in_progress" or "completed"
  3. Displaying these logs in real-time to the user
  4. Continuing to poll until the workflow run status is "completed"

Reference implementation (Solution 3 from GitHub Community Discussion #75518):

import requests
import time

def stream_workflow_logs(owner, repo, run_id, token):
    headers = {"Authorization": f"token {token}"}

    while True:
        # Check run status
        run_response = requests.get(
            f"https://api.github.com/repos/{owner}/{repo}/actions/runs/{run_id}",
            headers=headers
        )

        if run_response.json()["status"] == "completed":
            # Get final logs
            logs_response = requests.get(
                f"https://api.github.com/repos/{owner}/{repo}/actions/runs/{run_id}/logs",
                headers=headers
            )
            return logs_response.content

        # Get job logs during execution
        jobs_response = requests.get(
            f"https://api.github.com/repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
            headers=headers
        )

        for job in jobs_response.json()["jobs"]:
            if job["status"] in ["in_progress", "completed"]:
                job_logs = requests.get(
                    f"https://api.github.com/repos/{owner}/{repo}/actions/jobs/{job['id']}/logs",
                    headers=headers
                )
                if job_logs.status_code == 200:
                    print(f"Job {job['name']} logs available")

        time.sleep(10)

Alternatives:

  1. Opening the workflow directly in GitHub's web interface to view live logs (current workaround, but defeats the purpose of using ghactions-manager)
  2. Waiting for the job to complete before viewing logs (not ideal for long-running jobs)
  3. Using GitHub CLI (gh run watch) as a separate tool (adds friction to the workflow)

Additional context: This feature would significantly improve the user experience when monitoring workflows, especially for:

  • Long-running CI/CD pipelines
  • Debugging failing jobs in real-time
  • Monitoring deployment processes
  • Troubleshooting without switching between tools

The GitHub API supports fetching logs for in-progress jobs via the /repos/{owner}/{repo}/actions/jobs/{job_id}/logs endpoint, making this technically feasible.

v0rest avatar Nov 07 '25 15:11 v0rest

+1

vperfilyev-vitech avatar Nov 07 '25 18:11 vperfilyev-vitech

The GitHub API returns 404 for in_progress jobs - As can be seen in the discussion mentioned as well. It is being requeried every 30s - you can configure it in the plugin settings.

I am working on a feature to show at least the step statuses while the job is in progress - this will be in the paid version feature only.

cunla avatar Nov 08 '25 05:11 cunla