Skip to content
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

add status flag #13

Merged
merged 1 commit into from
May 15, 2023
Merged

add status flag #13

merged 1 commit into from
May 15, 2023

Conversation

rsese
Copy link
Owner

@rsese rsese commented May 15, 2023

closes #12

Adds a -s / --status flag so you can filter by workflow run status (https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow)

ran it locally -- first with everything:

❯ go run main.go  cli  -r"cli" -l 4h            
                                                                      GitHub Actions dashboard for cli for the past 4 hours                                                                      
                                                                                    Total billable time: 0ms                                                                                     

cli/cli https://github.com/cli/cli/actions
                                   
╔══════════════════════╗╔══════════════════════╗╔══════════════════════╗╔══════════════════════╗╔══════════════════════╗╔══════════════════════╗
║                      ║║                      ║║                      ║║                      ║║                      ║║                      ║
║ Tests                ║║ Lint                 ║║ Code Scanning        ║║ PR Automation        ║║ Issue Automation     ║║ Deployment           ║
║ Health: ✓✓x          ║║ Health: ✓✓✓          ║║ Health: ✓✓✓          ║║ No runs              ║║ No runs              ║║ No runs              ║
║ Avg elapsed: 5m42s   ║║ Avg elapsed: 1m23s   ║║ Avg elapsed: 2m52s   ║║                      ║║                      ║║                      ║
║                      ║║                      ║║                      ║╚══════════════════════╝╚══════════════════════╝╚══════════════════════╝
╚══════════════════════╝╚══════════════════════╝╚══════════════════════╝    

then with just failures:

❯ go run main.go  cli  -r"cli" -l 4h -s"failure"
                                                                      GitHub Actions dashboard for cli for the past 4 hours                                                                      
                                                                                    Total billable time: 0ms                                                                                     

cli/cli https://github.com/cli/cli/actions
                                   
╔══════════════════════╗╔══════════════════════╗╔══════════════════════╗╔══════════════════════╗╔══════════════════════╗╔══════════════════════╗
║                      ║║                      ║║                      ║║                      ║║                      ║║                      ║
║ Tests                ║║ Lint                 ║║ Code Scanning        ║║ PR Automation        ║║ Issue Automation     ║║ Deployment           ║
║ Health: x            ║║ No runs              ║║ No runs              ║║ No runs              ║║ No runs              ║║ No runs              ║
║ Avg elapsed: 1m42s   ║║                      ║║                      ║║                      ║║                      ║║                      ║
║                      ║╚══════════════════════╝╚══════════════════════╝╚══════════════════════╝╚══════════════════════╝╚══════════════════════╝
╚══════════════════════╝                      

(a flag to hide the No runs would probably be good too 🤔 )

@rsese rsese self-assigned this May 15, 2023
@rsese rsese merged commit e65ad25 into trunk May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add flag to filter by workflow run status
1 participant