Skip to content

Instantly share code, notes, and snippets.

@lucasmelin
Last active March 3, 2023 21:40
Show Gist options
  • Save lucasmelin/43a4df2de4e5498ad3706da72a8c1197 to your computer and use it in GitHub Desktop.
Save lucasmelin/43a4df2de4e5498ad3706da72a8c1197 to your computer and use it in GitHub Desktop.
Find and watch in-progress GitHub Actions workflow runs
workflow=$(gh workflow list | fzf | cut -f1) &&
gh api user \
| jq -r '.login' \
| xargs -I {} gh run list -u {} -w $workflow -b main --json name,number,status,displayTitle,databaseId \
--template '{{tablerow "ID" "Title" "Run number"}}{{range .}}{{if eq .status "in_progress"}}{{tablerow .databaseId .displayTitle (printf "#%v" .number)}}{{end}}{{end}}' \
| fzf --header-lines=1 \
| cut -w -f1 \
| xargs -I {} gh run watch {} --exit-status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment