Skip to content

Commit a874d5e

Browse files
committed
feat: add CreatedAt field to ActionWorkflowRun API
- Add CreatedAt field to ActionWorkflowRun struct in modules/structs/repo_actions.go - Set CreatedAt in ToActionWorkflowRun converter in services/convert/convert.go - This provides the creation timestamp for workflow runs in the API response
1 parent 3c00949 commit a874d5e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

modules/structs/repo_actions.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ type ActionWorkflowRun struct {
123123
HeadRepository *Repository `json:"head_repository,omitempty"`
124124
Conclusion string `json:"conclusion,omitempty"`
125125
// swagger:strfmt date-time
126+
CreatedAt time.Time `json:"created_at"`
127+
// swagger:strfmt date-time
126128
StartedAt time.Time `json:"started_at"`
127129
// swagger:strfmt date-time
128130
CompletedAt time.Time `json:"completed_at"`

services/convert/convert.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ func ToActionWorkflowRun(ctx context.Context, repo *repo_model.Repository, run *
258258
URL: fmt.Sprintf("%s/actions/runs/%d", repo.APIURL(), run.ID),
259259
HTMLURL: run.HTMLURL(),
260260
RunNumber: run.Index,
261+
CreatedAt: run.Created.AsLocalTime(),
261262
StartedAt: run.Started.AsLocalTime(),
262263
CompletedAt: run.Stopped.AsLocalTime(),
263264
Event: string(run.Event),

0 commit comments

Comments
 (0)