Skip to content

Add option to watch workflow run progress #3559

Description

@zhigang1992

Describe the feature or problem you’d like to solve

When trigger a GitHub action workflow dispatch with gh workflow run, I always want to watch it.

Currently I can do gh run list find the ID and then gh run watch $Id or gh run watch and select the one I just triggered.

Proposed solution

add option gh workflow run --watch that automatically does this.

Activity

  1. added
    coreThis issue is not accepting PRs from outside contributors
    on May 3, 2021
  2. samcoe commented on May 3, 2021

    @samcoe
    Contributor

    I agree I think this is a common use case and we should support it. I am going to mark this as core as we will want to discuss options on what we want the UX to look like for this feature.

  3. changed the title [-][Feature Request] - add option to watch in workflow run[/-] [+]Add option to watch workflow run progress[/+] on Jun 27, 2022
  4. mislav commented on Jun 27, 2022

    @mislav
    Contributor

    Currently blocked on #4001

  5. matschaffer-roblox commented on Jan 17, 2023

    @matschaffer-roblox

    I'd definitely love a gh workflow run -w option to bring up the browser to watch the run.

    Terminal would be cool too, but I'd want to see the detailed output rather than the summary provided by gh run watch today.

    For the time being I think this will probably be good enough since the top entry in run view is usually the one I just triggered. Posting incase it helps anyone else:

    gh workflow run (run args); sleep 5; gh run view -w
    
  6. mik3y commented on Jan 20, 2023

    @mik3y

    I hacked up a workaround for this that works well enough locally: mik3y@6359338

    It works by polling the the list of runs before and after, then selecting the first newly-appearing run. This is naturally a bit brittle due to #4001, though is already saving me plenty of time.

    I'm happy to PR the code, with any suggested improvements, if something like this would be acceptable.

  7. matschaffer-roblox commented on Feb 2, 2023

    @matschaffer-roblox

    @mik3y I'd recommend getting the PR open since it'll at least provide an easy point of discussion. It's a nice idea, but ultimately up to the gh maintainers to proceed in the face of #4001 or not.

  8. mik3y commented on Feb 4, 2023

    @mik3y

    Done, I've PR'd the hack here: #6965

  9. Yarden-zamir commented on Feb 22, 2023

    @Yarden-zamir

    My workaround is this :

    gh workflow run Sql-CreateNorthwindDb.yaml --field DB_IP="*" --field DB_NAME="*" --field MINI_VERSION="true" && sleep 5 && \
    gh run list --workflow=Sql-CreateNorthwindDb.yaml --json databaseId --limit 1 | jq '.[].databaseId' | \
    xargs gh run watch

    can probably be wrapped in a function.
    will break if multiple people run it at same time.
    if anyone knows how to relibly get the id of the run I just launched that would be best.

  10. jglick commented on Feb 18, 2026

    @jglick

    Does #12695 now unblock this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedcoreThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIgh-workflowrelating to the gh workflow command

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions