@@ -24,33 +24,51 @@ const command = new Command({
2424 describe : 'Build id' ,
2525 } )
2626 . option ( 'limit' , {
27+ alias : 'l' ,
2728 describe : 'Limit amount of returned results' ,
2829 default : DEFAULTS . GET_LIMIT_RESULTS ,
2930 } )
3031 . option ( 'page' , {
32+ alias : 'p' ,
3133 describe : 'Paginated page' ,
3234 default : DEFAULTS . GET_PAGINATED_PAGE ,
3335 } )
3436 . option ( 'status' , {
37+ alias : 's' ,
3538 describe : 'Filter results by statuses' ,
3639 type : Array ,
37- choices : [ 'pending' , 'elected' , 'error' , 'running' , 'success' , 'terminated' , 'terminating' ] ,
40+ choices : [ 'pending' , 'elected' , 'error' , 'running' , 'success' , 'terminated' , 'terminating' , 'pending-approval' ] ,
3841 } )
3942 . option ( 'trigger' , {
43+ alias : 't' ,
4044 describe : 'Filter results by triggers' ,
4145 type : Array ,
4246 choices : [ 'build' , 'launch-image' , 'launch-composition' ] ,
4347 } )
4448 . option ( 'pipeline-id' , {
49+ alias : 'pid' ,
4550 describe : 'Filter results by pipeline id' ,
4651 type : Array ,
4752 default : [ ] ,
4853 } )
4954 . option ( 'pipeline-name' , {
55+ alias : 'pipeline' ,
5056 describe : 'Filter results by pipeline name' ,
5157 type : Array ,
5258 default : [ ] ,
5359 } )
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+ } )
5472 . example ( 'codefresh get build ID' , 'Get build ID' )
5573 . example ( 'codefresh get builds' , 'Get all builds' )
5674 . example ( 'codefresh get builds --pipeline-id ID' , 'Get all builds that are executions of pipeline "ID"' )
@@ -60,7 +78,14 @@ const command = new Command({
6078 } ,
6179 handler : async ( argv ) => {
6280 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 ;
6489 const pipelineNames = ! _ . isArray ( argv [ 'pipeline-name' ] ) ? [ ( argv [ 'pipeline-name' ] ) ] : argv [ 'pipeline-name' ] ;
6590 const pipelineIds = ! _ . isArray ( argv [ 'pipeline-id' ] ) ? [ ( argv [ 'pipeline-id' ] ) ] : argv [ 'pipeline-id' ] ;
6691
@@ -87,6 +112,8 @@ const command = new Command({
87112 page,
88113 status,
89114 trigger,
115+ branchName,
116+ revision,
90117 pipeline : _ . isEmpty ( pipelineIds ) ? undefined : pipelineIds ,
91118 } ) ;
92119 Output . print ( result . workflows . docs . map ( Workflow . fromResponse ) ) ;
0 commit comments