Skip to content
Merged
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
11 changes: 9 additions & 2 deletions backend/controllers/projects_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,13 @@ func UpdateCheckRunForJob(gh utils.GithubClientProvider, job *models.DiggerJob)
return fmt.Errorf("could not get conclusion for job: %v", err)
}

// Only pass conclusion to GitHub API when job is completed (non-empty conclusion).
// GitHub rejects empty string as conclusion - it must be omitted for in-progress jobs.
var conclusionPtr *string
if conclusion != "" {
conclusionPtr = &conclusion
}

text := "" +
"```terraform\n" +
job.TerraformOutput +
Expand All @@ -296,7 +303,7 @@ func UpdateCheckRunForJob(gh utils.GithubClientProvider, job *models.DiggerJob)
title := fmt.Sprintf("%v to create %v to update %v to delete", job.DiggerJobSummary.ResourcesCreated, job.DiggerJobSummary.ResourcesUpdated, job.DiggerJobSummary.ResourcesDeleted)
opts := github.GithubCheckRunUpdateOptions{
Status: &status,
Conclusion: &conclusion,
Conclusion: conclusionPtr,
Title: &title,
Summary: &summary,
Text: &text,
Expand All @@ -310,7 +317,7 @@ func UpdateCheckRunForJob(gh utils.GithubClientProvider, job *models.DiggerJob)
title := fmt.Sprintf("%v created %v updated %v deleted", job.DiggerJobSummary.ResourcesCreated, job.DiggerJobSummary.ResourcesUpdated, job.DiggerJobSummary.ResourcesDeleted)
opts := github.GithubCheckRunUpdateOptions{
Status: &status,
Conclusion: &conclusion,
Conclusion: conclusionPtr,
Title: &title,
Summary: &summary,
Text: &text,
Expand Down
Loading