Skip to content

Commit 3dee6d1

Browse files
Add pipeline trigger for workflow (#328)
1 parent 70c39cd commit 3dee6d1

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

lib/interface/cli/commands/workflow/get.cmd.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ const command = new Command({
6969
type: Array,
7070
default: [],
7171
})
72+
.option('pipeline-trigger-id', {
73+
describe: 'Filter results by pipeline trigger id',
74+
type: Array,
75+
default: [],
76+
})
7277
.example('codefresh get build ID', 'Get build ID')
7378
.example('codefresh get builds', 'Get all builds')
7479
.example('codefresh get builds --pipeline-id ID', 'Get all builds that are executions of pipeline "ID"')
@@ -85,6 +90,7 @@ const command = new Command({
8590
trigger,
8691
branch: branchName,
8792
commitId: revision,
93+
'pipeline-trigger-id': pipelineTriggerId,
8894
} = argv;
8995
const pipelineNames = !_.isArray(argv['pipeline-name']) ? [(argv['pipeline-name'])] : argv['pipeline-name'];
9096
const pipelineIds = !_.isArray(argv['pipeline-id']) ? [(argv['pipeline-id'])] : argv['pipeline-id'];
@@ -114,6 +120,7 @@ const command = new Command({
114120
trigger,
115121
branchName,
116122
revision,
123+
pipelineTriggerId,
117124
pipeline: _.isEmpty(pipelineIds) ? undefined : pipelineIds,
118125
});
119126
Output.print(result.workflows.docs.map(Workflow.fromResponse));

lib/logic/entities/Workflow.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class Workflow extends Entity {
2323
'repository',
2424
'branch',
2525
'commit-Id',
26+
'pipeline-trigger-id',
2627
];
2728
}
2829

@@ -52,6 +53,7 @@ class Workflow extends Entity {
5253
progress: response.progress,
5354
'pipeline-Id': response.serviceId,
5455
'commit-Id': response.revision,
56+
'pipeline-trigger-id': response.pipelineTriggerId,
5557
});
5658
}
5759
}

openapi.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,6 +1661,14 @@
16611661
"type": "string"
16621662
},
16631663
"description": "branch name"
1664+
},
1665+
{
1666+
"name": "pipelineTriggerId",
1667+
"in": "query",
1668+
"schema": {
1669+
"type": "string"
1670+
},
1671+
"description": "Pipeline trigger id"
16641672
}
16651673
],
16661674
"responses": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.19.0",
3+
"version": "0.19.1",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)