Skip to content

Commit 2876a3c

Browse files
authored
feat(api): add pipeline name to event job summary (#6106)
1 parent b04e3e2 commit 2876a3c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

engine/api/workflow_event.go

+5
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ func NewEventJobSummary(wr sdk.WorkflowRun, noderun sdk.WorkflowNodeRun, jobrun
102102
GitCommit: noderun.VCSHash,
103103
}
104104

105+
node := wr.Workflow.WorkflowData.NodeByID(noderun.WorkflowNodeID)
106+
if node != nil && node.Context != nil {
107+
ejs.PipelineName = node.Context.PipelineName
108+
}
109+
105110
if wr.Version != nil {
106111
ejs.WorkflowRunVersion = *wr.Version
107112
} else {

sdk/event.go

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ type EventJobSummary struct {
147147
ProjectKey string `json:"project_key"`
148148
Workflow string `json:"workflow"`
149149
Pipeline string `json:"pipeline"`
150+
PipelineName string `json:"pipeline_name"`
150151
Job string `json:"job"`
151152
WorkflowRunVersion string `json:"workflow_run_version"`
152153
WorkflowRunNumber int `json:"workflow_run_number"`

0 commit comments

Comments
 (0)