-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Description
Describe the feature or problem you’d like to solve
To retrieve the number of the last completed and successful run the command looks like this:
gh run list --json number,conclusion,status -q '.[] | if .conclusion == "success" and .status == "completed" then .number else empty end' | head -1
However, there may not be a successful run in the last 20 runs. Currently the only solution to be confident to retrieve a build number is to set an absurdly hugh --limit value, but this method is a waste of resources in addition of not being resilient.
Proposed solution
A --successful-runs (or so) switch would be perfect here, and would greatly complement the --limit option: for instance gh run list --successful-runs --limit 3 would return the last 3 successful runs.
Additional context
Add any other context like screenshots or mockups are helpful, if applicable.