@@ -183,12 +183,10 @@ func runSimulateCI(ctx context.Context, config *simulateConfig) error {
183183
184184 _ , _ , _ , failed := simulationJobCounts (run )
185185 if failed > 0 || run .Status == livekit .SimulationRun_STATUS_FAILED {
186- if isGitHubActions () {
187- if failed > 0 {
188- fmt .Fprintf (os .Stdout , "::error::%d simulation(s) failed\n " , failed )
189- } else {
190- fmt .Fprintf (os .Stdout , "::error::Simulation run failed: %s\n " , run .Error )
191- }
186+ if failed > 0 {
187+ fmt .Fprintf (os .Stdout , "::error::%d simulation(s) failed\n " , failed )
188+ } else {
189+ fmt .Fprintf (os .Stdout , "::error::Simulation run failed: %s\n " , run .Error )
192190 }
193191 if run .Status == livekit .SimulationRun_STATUS_FAILED && len (run .Jobs ) == 0 {
194192 return fmt .Errorf ("simulation failed: %s" , run .Error )
@@ -199,10 +197,9 @@ func runSimulateCI(ctx context.Context, config *simulateConfig) error {
199197 return nil
200198}
201199
202- // writeRunResults writes the per-job results and the run summary. With gh set,
203- // sections are wrapped in GitHub Actions group markers and failed jobs emit
204- // ::error:: annotations on GitHub.
205- func writeRunResults (w io.Writer , run * livekit.SimulationRun , ap * AgentProcess , gh bool ) {
200+ // writeRunResults writes the per-job results and the run summary, using GitHub
201+ // Actions group markers (harmless and a useful delimiter outside GitHub too).
202+ func writeRunResults (w io.Writer , run * livekit.SimulationRun , ap * AgentProcess ) {
206203 if run == nil {
207204 return
208205 }
@@ -226,11 +223,7 @@ func writeRunResults(w io.Writer, run *livekit.SimulationRun, ap *AgentProcess,
226223 label = fmt .Sprintf ("Job %d" , i + 1 )
227224 }
228225
229- if gh {
230- fmt .Fprintf (w , "::group::%s %s\n " , icon , label )
231- } else {
232- fmt .Fprintf (w , "%s %s (%s)\n " , icon , label , job .Id )
233- }
226+ fmt .Fprintf (w , "::group::%s %s (%s)\n " , icon , label , job .Id )
234227
235228 if job .Instructions != "" {
236229 fmt .Fprintln (w , "Instructions:" )
@@ -268,20 +261,16 @@ func writeRunResults(w io.Writer, run *livekit.SimulationRun, ap *AgentProcess,
268261 }
269262 }
270263
271- if gh {
272- fmt .Fprintln (w , "::endgroup::" )
273- } else {
274- fmt .Fprintln (w )
275- }
264+ fmt .Fprintln (w , "::endgroup::" )
276265
277- if job .Status == livekit .SimulationRun_Job_STATUS_FAILED && gh && isGitHubActions () {
266+ if job .Status == livekit .SimulationRun_Job_STATUS_FAILED {
278267 firstLine , _ , _ := strings .Cut (job .Error , "\n " )
279268 fmt .Fprintf (w , "::error::Job %d failed: %s\n " , i + 1 , firstLine )
280269 }
281270 }
282271
283272 if run .Summary != nil {
284- writeRunSummary (w , run , gh )
273+ writeRunSummary (w , run )
285274 } else {
286275 msg := "The summary for this run is not available"
287276 if run .Error != "" {
@@ -292,16 +281,12 @@ func writeRunResults(w io.Writer, run *livekit.SimulationRun, ap *AgentProcess,
292281 }
293282}
294283
295- func writeRunSummary (w io.Writer , run * livekit.SimulationRun , gh bool ) {
284+ func writeRunSummary (w io.Writer , run * livekit.SimulationRun ) {
296285 summary := run .Summary
297286 total , _ , passed , failed := simulationJobCounts (run )
298287
299288 fmt .Fprintln (w )
300- if gh {
301- fmt .Fprintln (w , "::group::Summary" )
302- } else {
303- fmt .Fprintln (w , "Summary" )
304- }
289+ fmt .Fprintln (w , "::group::Summary" )
305290 fmt .Fprintf (w , "%d total, %d passed, %d failed\n " , total , passed , failed )
306291
307292 if summary .GoingWell != "" {
@@ -331,9 +316,7 @@ func writeRunSummary(w io.Writer, run *livekit.SimulationRun, gh bool) {
331316 }
332317 }
333318
334- if gh {
335- fmt .Fprintln (w , "::endgroup::" )
336- }
319+ fmt .Fprintln (w , "::endgroup::" )
337320}
338321
339322func writeChatHistory (w io.Writer , chatCtx * agent.ChatContext ) {
@@ -376,7 +359,3 @@ func writeChatHistory(w io.Writer, chatCtx *agent.ChatContext) {
376359 }
377360 }
378361}
379-
380- func isGitHubActions () bool {
381- return os .Getenv ("GITHUB_ACTIONS" ) != ""
382- }
0 commit comments