From 5db95aecc96daed3933594587166cc93feb8d7f5 Mon Sep 17 00:00:00 2001 From: Igor Zalutski Date: Mon, 24 Nov 2025 22:44:07 +0200 Subject: [PATCH] Fix conclusion in checks api call --- backend/controllers/projects_helpers.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/backend/controllers/projects_helpers.go b/backend/controllers/projects_helpers.go index 2a3ea20a3..b59fd88cc 100644 --- a/backend/controllers/projects_helpers.go +++ b/backend/controllers/projects_helpers.go @@ -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 + @@ -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, @@ -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,