|
1 | 1 | // |
2 | | -// Copyright 2024 The Chainloop Authors. |
| 2 | +// Copyright 2024-2025 The Chainloop Authors. |
3 | 3 | // |
4 | 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | // you may not use this file except in compliance with the License. |
@@ -80,6 +80,7 @@ const ( |
80 | 80 |
|
81 | 81 | type WorkflowRunRepoCreateResult struct { |
82 | 82 | Run *WorkflowRun |
| 83 | + Project *Project |
83 | 84 | VersionCreated bool |
84 | 85 | } |
85 | 86 |
|
@@ -247,16 +248,16 @@ func (uc *WorkflowRunUseCase) Create(ctx context.Context, opts *WorkflowRunCreat |
247 | 248 | } |
248 | 249 |
|
249 | 250 | // Dispatch audit event for project version creation if a new version was created |
250 | | - if result.VersionCreated && result.Run != nil && result.Run.Workflow != nil && uc.auditorUC != nil { |
| 251 | + if result.VersionCreated && uc.auditorUC != nil && result.Project != nil { |
251 | 252 | uc.auditorUC.Dispatch(ctx, &events.ProjectVersionCreated{ |
252 | 253 | ProjectBase: &events.ProjectBase{ |
253 | | - ProjectID: &result.Run.Workflow.ProjectID, |
254 | | - ProjectName: result.Run.Workflow.Project, |
| 254 | + ProjectID: &result.Project.ID, |
| 255 | + ProjectName: result.Project.Name, |
255 | 256 | }, |
256 | 257 | VersionID: &result.Run.ProjectVersion.ID, |
257 | 258 | Version: result.Run.ProjectVersion.Version, |
258 | 259 | Prerelease: result.Run.ProjectVersion.Prerelease, |
259 | | - }, &result.Run.Workflow.OrgID) |
| 260 | + }, &result.Project.OrgID) |
260 | 261 | } |
261 | 262 |
|
262 | 263 | return result.Run, nil |
|
0 commit comments