If a GitHub Actions job stays on "Queued" for more than a minute or two, something specific is holding it. It's usually one of seven things, and adding runners only fixes some of them.
Below is each cause, how to spot it, and what to change. Get real numbers first, because the Actions UI doesn't show you queue time.
Before anything: measure the wait
The API has what you need. Every job has a created_at (when it was queued) and a started_at (when a runner took it). The difference is your queue time.
This lists the jobs that waited longest across your last 30 runs:
OWNER = your-org REPO = your-repo
gh api "repos/$OWNER/$REPO/actions/runs?per_page=30" --jq '.workflow_runs[].id' | while read -r run ; do gh api "repos/$OWNER/$REPO/actions/runs/$run/jobs?per_page=100" --jq ' .jobs[] | select(.started_at != null and .runner_name != null) | [((.started_at | fromdate) - (.created_at | fromdate)), (.labels | join(",")), .name] | @tsv' done | sort -rn | head -20
Enter fullscreen mode
Exit fullscreen mode
The…