Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/services/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -660,11 +660,11 @@ func (g gitHubService) Send(notification Notification, _ Destination) error {
}

if notification.GitHub.CheckRun != nil {
startedTime, err := time.Parse("YYYY-MM-DDTHH:MM:SSZ", notification.GitHub.CheckRun.StartedAt)
startedTime, err := time.Parse(time.RFC3339, notification.GitHub.CheckRun.StartedAt)
if err != nil {
return err
}
completedTime, err := time.Parse("YYYY-MM-DDTHH:MM:SSZ", notification.GitHub.CheckRun.CompletedAt)
completedTime, err := time.Parse(time.RFC3339, notification.GitHub.CheckRun.CompletedAt)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think completedTime should be optional, so it will work when the Status is in_progress and completedTime shouldn't be set yet

if err != nil {
return err
}
Expand All @@ -687,6 +687,8 @@ func (g gitHubService) Send(notification Notification, _ Destination) error {
ExternalID: &externalID,
Name: notification.GitHub.CheckRun.Name,
DetailsURL: &notification.GitHub.CheckRun.DetailsURL,
Status: &notification.GitHub.CheckRun.Status,
Conclusion: &notification.GitHub.CheckRun.Conclusion,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same here, need to make sure it can work when Conclusion is not set, because:

Required if you provide completed_at or a status of completed. The final conclusion of the check. Note: Providing conclusion will automatically set the status parameter to completed. You cannot change a check run conclusion to stale, only GitHub can set this.

StartedAt: &github.Timestamp{Time: startedTime},
CompletedAt: &github.Timestamp{Time: completedTime},
Output: checkRunOutput,
Expand Down