New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow filtering workflow runs by date range in gh run list #9042
Comments
I may have found a solution. |
@hatsu38 : Thank you for opening up this idea as well as sharing what you learned figuring it out! ❤ As you discovered,
cli/pkg/cmd/run/shared/shared.go Lines 333 to 365 in 4896546
SuggestionThe $ gh run list --help
List recent workflow runs
For more information about output formatting flags, see `gh help formatting`.
USAGE
gh run list [flags]
ALIASES
ls
FLAGS
-b, --branch string Filter runs by branch
-c, --commit SHA Filter runs by the SHA of the commit
--created date Filter runs by the date it was created
-e, --event event Filter runs by which event triggered the run
-q, --jq expression Filter JSON output using a jq expression
--json fields Output JSON with the specified fields
-L, --limit int Maximum number of runs to fetch (default 20)
-s, --status string Filter runs by status: {queued|completed|in_progress|requested|waiting|action_required|cancelled|failure|neutral|skipped|stale|startup_failure|success|timed_out}
-t, --template string Format JSON output using a Go template; see "gh help formatting"
-u, --user string Filter runs by user who triggered the run
-w, --workflow string Filter runs by workflow
INHERITED FLAGS
--help Show help for command
-R, --repo [HOST/]OWNER/REPO Select another repository using the [HOST/]OWNER/REPO format
LEARN MORE
Use `gh <command> <subcommand> --help` for more information about a command.
Read the manual at https://cli.github.com/manual More specifically: --created date Filter runs by the date it was created @hatsu38 : is there anything else you'd suggest for improving the experience? |
Describe the feature or problem you'd like to solve
The current
gh run list
command does not allow filtering workflow runs within a specific date range. Whilegh run list --created 2024-05-03
works to filter by a single date, it is not possible to search across multiple dates or a date range.I would like to be able to view a list of jobs within a one-month period using this feature.
Proposed solution
We propose adding options like
--from
and--to
to thegh run list
command, which would allow displaying only the workflow runs within the specified date range.Additional context
I attempted to search for a one-month list of jobs and then calculate the usage time per job for that month, but the lack of date range filtering made this task cumbersome.
The text was updated successfully, but these errors were encountered: