Commit graph

98 commits

Author SHA1 Message Date
William Martin
9a3dc9fce7 Fix log terminal injection 2026-04-23 13:56:33 +02:00
William Martin
24964681a8 Respect --exit-status with --log and --log-failed
Fixes #12674
2026-02-13 16:04:06 +01:00
William Martin
7eef7af23d Reformat gh run view help 2025-07-04 17:25:59 +02:00
Babak K. Shandiz
0d8d330eb1
docs(run view): explain restrictions of fallback API calls
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-07-04 16:20:08 +01:00
Babak K. Shandiz
6d65904fee
refactor(run view): use API as fallback to fetch job logs
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-07-04 14:11:09 +01:00
William Martin
408e21ebdd
Merge pull request #10769 from cli/babakks/fix-job-log-resolution
Fix job log resolution to skip legacy logs in favour of normal/new ones
2025-04-11 16:16:39 +02:00
Babak K. Shandiz
f337ce90a0
Explain job log resolution reason
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-11 14:51:39 +01:00
William Martin
48274f3118 Document UNKNOWN STEP in run view 2025-04-11 15:23:18 +02:00
Babak K. Shandiz
b65286125b
Add $ anchor to log file regexps
Signed-off-by: Babak K. Shandiz <babakks@github.com>

This is to make sure we do not pick up the wrong file if there is a
`.txt` sequence in the middle of a job name.
2025-04-11 12:41:31 +01:00
Babak K. Shandiz
940bd10a1d
Prefer normal job run log file over legacy one
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-11 12:39:09 +01:00
William Martin
83bd23b080
Merge pull request #10740 from cli/babakks/fallback-to-job-run-logs
Fallback to job run logs when step logs are missing
2025-04-11 11:39:07 +02:00
Babak K. Shandiz
5adf3285ec
Explain when a negative number prefix appears
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-11 10:26:14 +01:00
Babak K. Shandiz
d35236948c
Improve explanation for missing step logs
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-11 10:17:52 +01:00
Babak K. Shandiz
1bf1153c54
Explain the UNKNWON STEP placeholder
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-11 10:08:36 +01:00
Babak K. Shandiz
f673b409f7
Replace UNKNOWN with UNKNOWN STEP in job run log
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-11 09:57:13 +01:00
Babak K. Shandiz
0251a8dd6d
Explain why step logs are preferred
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-11 09:56:17 +01:00
Babak K. Shandiz
5e78832a7e
Fallback to print entire job run log if step logs are missing
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-07 13:54:29 +01:00
Babak K. Shandiz
4dee1c3c98
Add jobLogFilenameRegexp function
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-07 13:54:28 +01:00
Babak K. Shandiz
2582948d5f
Extract job name sanitization as a separate function
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-07 13:54:20 +01:00
Andy Feller
918cafc222 Deprecate ColorScheme.Gray for ColorScheme.Muted
This commit converts all of the places using ColorScheme.Gray and ColorScheme.Grayf to Muted and Mutedf.

There is a little extra tidying up with local variable names or converting code to use Mutedf format.
2025-04-06 10:18:48 -04:00
benebsiny
64415df08d fix the trimming of log filenames for gh run view 2024-08-18 16:57:19 +08:00
Wing
f647131e1d
Gracefully degrade when fetching annotations fails due to 403 (#9113)
Co-authored-by: William Martin <williammartin@github.com>
2024-06-13 14:33:06 +02:00
William Martin
61a698a55a Add support for jobs with long filenames
Co-authored-by: John Basila <john@orca.security>
Co-authored-by: Shay Nehmad <shay.nehmad@orca.security>
2024-05-06 11:32:41 +02:00
William Martin
bbeccd69ad Ensure run log cache creates cache dir if it doesn't exist 2024-04-08 15:51:29 +02:00
William Martin
b6239238c8
Merge pull request #8931 from cli/wm/run-log-cache-stronger-abstraction
Create stronger run log cache abstraction
2024-04-05 16:00:28 +02:00
William Martin
c2aee1e402 Ensure cache dir is always available in RunLogCache 2024-04-05 15:39:33 +02:00
William Martin
103586a94c Remove RunLogCache interface 2024-04-05 15:33:49 +02:00
William Martin
e644dc50d6 Capture error on Run Log Cache Exists 2024-04-05 15:16:12 +02:00
William Martin
a89d50fc63 Rework Run Log Cache so that cache dir is injected 2024-04-05 14:59:24 +02:00
Rachel Evans
628ade89a7 Anchor the log filename to the start 2024-03-28 13:08:42 +01:00
William Martin
90fc403813 Document run watch and view not supporting fine grained PATs 2024-03-19 14:52:43 +01:00
Andy Feller
3bb5f54073 Apply first round of owner/repo#number consistency
This commit expands on @nobe4 initial work by bringing the owner and repository name to the most obvious issue and PR number output use cases before making a second pass for any edge cases.
2024-03-01 14:03:18 -05:00
benebsiny
0b73f2af86 Verify the downloaded zip for gh run view --log 2023-12-14 01:54:16 +08:00
William Martin
8364301017 Simplify run view annotation fetch error handling 2023-11-06 12:40:13 +01:00
Arun Sathiya
9d04ee6c8d
update(run): Use attempt input when fetching jobs (#7831)
* Introduce attempt flag for run watch and use attempt input when fetching jobs

* Handle attempt input for 'run watch' commands instead of using the latest attempt

* Revert attempt flag implementation for 'run watch' command because it is intended only for the latest attempt

* Fix tests for cases when attempt flag is used on 'run view' command

---------

Co-authored-by: Andy Feller <andyfeller@github.com>
2023-10-03 14:36:47 +02:00
William Martin
2d3047c7e3 Support viewing logs for jobs with composite actions 2023-06-02 13:40:53 +02:00
vilmibm
8a605fbaf5 Merge remote-tracking branch 'upstream/trunk' into run-prompts 2023-05-19 10:25:18 -07:00
Alexander Seiler
218f29f296
Correct some typos 2023-04-21 03:51:31 +02:00
nate smith
9010a2e12c use new prompter in run view 2023-04-10 16:21:47 -07:00
Wing-Kam Wong
48ed914d58 refactor: set the default case first 2023-03-28 21:21:11 +08:00
Wing-Kam Wong
cc554135e8 fix: change MaximumNArgs from 2 to 1 in run view.go 2023-03-28 21:16:04 +08:00
Wing-Kam Wong
a4c77ffd92 feat: include attempt in getRunLog 2023-03-26 19:12:21 +08:00
Wing-Kam Wong
343e730016 feat: pass attempt to RenderRunHeader 2023-03-26 14:38:05 +08:00
Wing-Kam Wong
2894695652 feat: add attempt flag to run view 2023-03-26 14:11:03 +08:00
Natthakit Susanthitanon
8617eb7df9
Add jobs field for run view --json (#6507)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-11-03 12:59:35 +00:00
Isaac Shalom
f1be4dc51c
Fix looking up workflow name for workflow runs (#6266)
The API field `WorkflowRun.name` is not guaranteed to correspond to the workflow name anymore. This introduces additional API lookups that resolve Workflows by their ID and look up their name in a future-proof fashion.

It also adds two new JSON fields for export: `displayTitle` and `workflowName`.

Co-authored-by: Christina Guo <61271066+guo-chris@users.noreply.github.com>
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-09-21 20:41:19 +02:00
Sam Coe
e7102f9d84
Migrate to go-gh text package (#6236) 2022-09-14 09:23:55 +04:00
Sam Coe
6a8deb1f5a
Integrate latest go-gh packages (#6084) 2022-08-18 09:04:13 +03:00
vilmibm
41385477c3 fix linting 2022-07-27 14:15:27 -05:00
Mislav Marohnić
02881b4783
Correctly determine run started/elapsed timestamps (#5945)
This switches `run list` and `run view` commands to measure how long ago did the run happen by using `run_started_at`, which is the timestamp of the latest run in a series, instead of `created_at`, which is the timestamp of the first run. This change also fixes accurate duration for in-progress runs.
2022-07-21 17:30:46 +02:00