diff --git a/Octokit.Tests/Models/WorkflowJobTests.cs b/Octokit.Tests/Models/WorkflowJobTests.cs index 16a8901c43..e16fe58e45 100644 --- a/Octokit.Tests/Models/WorkflowJobTests.cs +++ b/Octokit.Tests/Models/WorkflowJobTests.cs @@ -19,6 +19,7 @@ public void CanBeDeserialized() ""html_url"": ""https://github.com/octo-org/octo-repo/runs/399444496"", ""status"": ""completed"", ""conclusion"": ""success"", +""created_at"": ""2020-01-20T17:42:40Z"", ""started_at"": ""2020-01-20T17:42:40Z"", ""completed_at"": ""2020-01-20T17:44:39Z"", ""name"": ""build"", @@ -129,6 +130,7 @@ public void CanBeDeserialized() Assert.Equal("https://github.com/octo-org/octo-repo/runs/399444496", payload.HtmlUrl); Assert.Equal(WorkflowJobStatus.Completed, payload.Status); Assert.Equal(WorkflowJobConclusion.Success, payload.Conclusion); + Assert.Equal(new DateTimeOffset(2020, 01, 20, 17, 42, 40, TimeSpan.Zero), payload.CreatedAt); Assert.Equal(new DateTimeOffset(2020, 01, 20, 17, 42, 40, TimeSpan.Zero), payload.StartedAt); Assert.Equal(new DateTimeOffset(2020, 01, 20, 17, 44, 39, TimeSpan.Zero), payload.CompletedAt); Assert.Equal("build", payload.Name); diff --git a/Octokit/Models/Response/WorkflowJob.cs b/Octokit/Models/Response/WorkflowJob.cs index d485d425fc..d326483bba 100644 --- a/Octokit/Models/Response/WorkflowJob.cs +++ b/Octokit/Models/Response/WorkflowJob.cs @@ -10,7 +10,7 @@ public class WorkflowJob { public WorkflowJob() { } - public WorkflowJob(long id, long runId, string runUrl, string nodeId, string headSha, string url, string htmlUrl, WorkflowJobStatus status, WorkflowJobConclusion? conclusion, DateTimeOffset startedAt, DateTimeOffset? completedAt, string name, IReadOnlyList steps, string checkRunUrl, IReadOnlyList labels, long? runnerId = default, string runnerName = default, long? runnerGroupId = default, string runnerGroupName = default) + public WorkflowJob(long id, long runId, string runUrl, string nodeId, string headSha, string url, string htmlUrl, WorkflowJobStatus status, WorkflowJobConclusion? conclusion, DateTimeOffset createdAt, DateTimeOffset startedAt, DateTimeOffset? completedAt, string name, IReadOnlyList steps, string checkRunUrl, IReadOnlyList labels, long? runnerId = default, string runnerName = default, long? runnerGroupId = default, string runnerGroupName = default) { Id = id; RunId = runId; @@ -21,6 +21,7 @@ public WorkflowJob(long id, long runId, string runUrl, string nodeId, string hea HtmlUrl = htmlUrl; Status = status; Conclusion = conclusion; + CreatedAt = createdAt; StartedAt = startedAt; CompletedAt = completedAt; Name = name; @@ -78,6 +79,11 @@ public WorkflowJob(long id, long runId, string runUrl, string nodeId, string hea /// public StringEnum? Conclusion { get; private set; } + /// + /// The time that the job was created. + /// + public DateTimeOffset CreatedAt { get; private set; } + /// /// The time that the job started. ///