Skip to content

Instantly share code, notes, and snippets.

@frane
Last active March 9, 2021 12:13
Show Gist options
  • Save frane/d960c924f48b12fce63d8f525d4b9971 to your computer and use it in GitHub Desktop.
Save frane/d960c924f48b12fce63d8f525d4b9971 to your computer and use it in GitHub Desktop.
GitHub CLI command (alias) to list recent GitHub Action jobs.
# install gh (https://cli.github.com), install jq (https://stedolan.github.io/jq/), then run
gh alias set --shell jobs "gh api /repos/:owner/:repo/actions/runs | jq '(\"Name\" + \" \" * 20)[:20] + \" | \" + (\"Commit\" + \" \" * 50)[:50] + \" | \" + (\"Status\" + \" \" * 20)[:10] + \" | Time \", (.workflow_runs[] | (.name + \" \" * 20)[:20] + \" | \" + (.head_commit.message + \" \" * 100)[:50] + \" | \" + (.status + \" \" * 20)[:10] + \" | \" + .updated_at)' | sed 's/\"//g'"
# in a GitHub repo run
gh jobs
# to se the most recent jobs and statuses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment