@@ -24,33 +24,51 @@ const command = new Command({
24
24
describe : 'Build id' ,
25
25
} )
26
26
. option ( 'limit' , {
27
+ alias : 'l' ,
27
28
describe : 'Limit amount of returned results' ,
28
29
default : DEFAULTS . GET_LIMIT_RESULTS ,
29
30
} )
30
31
. option ( 'page' , {
32
+ alias : 'p' ,
31
33
describe : 'Paginated page' ,
32
34
default : DEFAULTS . GET_PAGINATED_PAGE ,
33
35
} )
34
36
. option ( 'status' , {
37
+ alias : 's' ,
35
38
describe : 'Filter results by statuses' ,
36
39
type : Array ,
37
- choices : [ 'pending' , 'elected' , 'error' , 'running' , 'success' , 'terminated' , 'terminating' ] ,
40
+ choices : [ 'pending' , 'elected' , 'error' , 'running' , 'success' , 'terminated' , 'terminating' , 'pending-approval' ] ,
38
41
} )
39
42
. option ( 'trigger' , {
43
+ alias : 't' ,
40
44
describe : 'Filter results by triggers' ,
41
45
type : Array ,
42
46
choices : [ 'build' , 'launch-image' , 'launch-composition' ] ,
43
47
} )
44
48
. option ( 'pipeline-id' , {
49
+ alias : 'pid' ,
45
50
describe : 'Filter results by pipeline id' ,
46
51
type : Array ,
47
52
default : [ ] ,
48
53
} )
49
54
. option ( 'pipeline-name' , {
55
+ alias : 'pipeline' ,
50
56
describe : 'Filter results by pipeline name' ,
51
57
type : Array ,
52
58
default : [ ] ,
53
59
} )
60
+ . option ( 'branch' , {
61
+ alias : 'b' ,
62
+ describe : 'Filter results by branch' ,
63
+ type : Array ,
64
+ default : [ ] ,
65
+ } )
66
+ . option ( 'commit-id' , {
67
+ alias : [ 'revision' , 'r' , 'sha' ] ,
68
+ describe : 'Filter results by commit revision sha' ,
69
+ type : Array ,
70
+ default : [ ] ,
71
+ } )
54
72
. example ( 'codefresh get build ID' , 'Get build ID' )
55
73
. example ( 'codefresh get builds' , 'Get all builds' )
56
74
. example ( 'codefresh get builds --pipeline-id ID' , 'Get all builds that are executions of pipeline "ID"' )
@@ -60,7 +78,14 @@ const command = new Command({
60
78
} ,
61
79
handler : async ( argv ) => {
62
80
const workflowIds = argv . id ;
63
- const { limit, page, status, trigger } = argv ;
81
+ const {
82
+ limit,
83
+ page,
84
+ status,
85
+ trigger,
86
+ branch : branchName ,
87
+ commitId : revision ,
88
+ } = argv ;
64
89
const pipelineNames = ! _ . isArray ( argv [ 'pipeline-name' ] ) ? [ ( argv [ 'pipeline-name' ] ) ] : argv [ 'pipeline-name' ] ;
65
90
const pipelineIds = ! _ . isArray ( argv [ 'pipeline-id' ] ) ? [ ( argv [ 'pipeline-id' ] ) ] : argv [ 'pipeline-id' ] ;
66
91
@@ -87,6 +112,8 @@ const command = new Command({
87
112
page,
88
113
status,
89
114
trigger,
115
+ branchName,
116
+ revision,
90
117
pipeline : _ . isEmpty ( pipelineIds ) ? undefined : pipelineIds ,
91
118
} ) ;
92
119
Output . print ( result . workflows . docs . map ( Workflow . fromResponse ) ) ;
0 commit comments