Commit graph

235 commits

Author SHA1 Message Date
Arseni Dziamidchyk
f9767d0a9a add pending status for workflow runs 2024-12-26 19:10:06 +03:00
Uday R
8afb434e59 test(gh run): assert branch names are enclosed in square brackets 2024-12-09 12:45:36 -05:00
Uday R
463105d648 fix: list branches in square brackets in gh run view (#10038) 2024-12-08 12:33:08 -05:00
William Martin
9bd8f09774 Use safepaths for run download 2024-12-04 22:12:58 +01:00
William Martin
a47b4c9f1d Use consistent slice ordering in run download tests 2024-12-04 13:02:25 +01:00
Andy Feller
8720479b0b Consolidate logic for isolating artifacts 2024-12-03 13:33:00 -05:00
Andy Feller
cdfc12caf5 Expand logic and tests to handle edge cases
This commit expands filepathDescendsFrom(string, string) to handle edge cases such as mixing absolute and relative paths or artifact name edge cases.

Additionally, tests for filepathDescendsFrom() and downloadrun() have been expanded to verify additional use cases.
2024-11-22 15:26:11 -05:00
Andy Feller
e7c5706336 Refactor download testing, simpler file descends
This incorporates the work done by @williammartin to improve reasoning about `gh run download` behavior through testing while verifying a simpler solution to checking if a path is contained within a directory.
2024-11-21 17:07:27 -05:00
Tyler McGoffin
83cf411556 Improve test names so there is no repetition 2024-11-19 16:08:31 -08:00
Andy Feller
8da27d2c8a Second attempt to address exploit
This builds off suggestion to reuse logic used already within `gh run download` for detecting path traversals.

This largely works but runs into an issue where detection logic doesn't handle non-separated traversal.
2024-11-19 17:55:18 -05:00
Aarni Koskela
1c4c8e5145 Fix verbiage for deleting workflow runs
It's not deleting _workflows_ (which are specified in YAML)...
2024-11-04 17:55:35 +02:00
Andy Feller
86b4bb9956 Include startedAt, completedAt in run steps data
This commit expands the `Step` structure used with GitHub Actions workflow runs to include fields indicating when steps start and complete.

This information is already provided by the GitHub API, so this only involves expanding the structure, fields exported, and the associated tests.

In the future, I could see `gh` including the duration calculation which is used when viewing workflow or workflow run.
2024-10-16 19:38:10 -04:00
Andy Feller
19daa35c81
Merge pull request #9482 from benebsiny/cli-9153
fix the trimming of log filenames for `gh run view`
2024-08-22 15:23:06 -04:00
benebsiny
64415df08d fix the trimming of log filenames for gh run view 2024-08-18 16:57:19 +08:00
Heath Stewart
81f3526740
Fix tests 2024-08-16 10:11:52 -07:00
Junichi Sato
330a385f9e
Document that gh run download downloads the latest artifact by default
This commit addresses the documentation issue.

The discussion at #7018 has confirmed that it is undocumented that
the current behavior of `gh run download` with `-n` and no `run-id`
downloads the latest artifact.

Although the behavior has not been created intentionally, it is the one
that should be documented and the future releases should warn before
a breaking change.
2024-08-08 19:35:16 +09:00
Yukai Chou
d7b8ecf33d Unify use of tab indent in non-test source files
Found with
    rg '(^ | \t|\t )' -g '*.go' -g '!*_test.go'

Mixed indent exceptions:
- wrapped long list items with extra 2-space indent
- code snippets using space indent
- commented code lines having "\t*// \t+" prefix
2024-08-03 00:35:30 +08:00
Andy Feller
5e7ba54b56
Merge pull request #9162 from joshuajtward/chore/GH-9038
feat: add `-a` flag to `gh run list`
2024-06-13 11:40:08 -04:00
Andy Feller
6190e269a0 Add gh run list tests for workflow selector
This commit adds tests to ensure disabled workflows are outputted as expected when called by name and the appropriate flags.
2024-06-13 11:30:38 -04: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
Josh Ward
c2f2753051 add comment to call out potentially brittle use of workflowShared 2024-06-13 09:24:18 +01:00
Josh Ward
a10e532898 feat: add -a flag to gh run list 2024-06-03 09:53:34 +01:00
cawfeecake
105bafd2ec
fix: rename the Attempts field to Attempt; expose in gh run view and gh run ls (#8905)
Co-authored-by: William Martin <williammartin@github.com>
2024-05-22 14:39:13 +02:00
William Martin
7dc7b9838d
Merge pull request #9052 from jasonodonnell/trunk
Fix doc bug for gh run watch
2024-05-21 18:04:24 +02:00
William Martin
1d38230675
Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
Jason O'Donnell
1f07de7557 Fix doc bug for gh run watch 2024-05-06 12:04:52 -04: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
Stanislav Ochotnický
4aa18a9b9a Make it clearer that job flag is meant to be an ID 2024-04-17 13:53:55 +02:00
Stanislav Ochotnický
40be4b366c Ignore run-id when providing also job for rerun
This makes the behaviour consistent with gh run view.
2024-04-17 13:49:16 +02:00
William Martin
61584b83cb Close zip file in run view tests 2024-04-08 16:50:43 +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
a3ffc1ca33 Use real Run Log Cache in run view tests 2024-04-05 15:18:18 +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
EBIBO
be81f9f0cb
Merge branch 'trunk' into cli-8009 2023-12-13 12:56:26 -05:00
benebsiny
0b73f2af86 Verify the downloaded zip for gh run view --log 2023-12-14 01:54:16 +08:00
William Martin
a9bdd8d186 Fix flaky tests coupled to relative dates 2023-12-13 14:44:16 +01:00
Andy Feller
b442a1b4d2 Fix run exported jobs error for completedAt 2023-12-11 08:42:43 -05:00
Andy Feller
c7c74dd422
Merge pull request #8342 from muzimuzhi/docs/unify-markup
Unify doc mark-ups
2023-12-01 09:31:36 -05:00
nelsonchen304
3bb62d4724
Actions: filter to workflow runs for a specific commit (#8350) 2023-11-29 09:29:26 +00:00
Yukai Chou
afbdb945bc Small docs tweaks 2023-11-23 07:14:38 +08:00
Yukai Chou
ba585149c3 Leftovers 2023-11-23 07:12:47 +08:00
Yukai Chou
21bf1babdf Proof-reading 2023-11-17 02:04:35 +08:00
Yukai Chou
b70c28ba20 Misc docs improvements 2023-11-17 01:32:28 +08:00