@@ -3,6 +3,7 @@ package script
33import (
44 "context"
55 "fmt"
6+ "strings"
67 "time"
78
89 "github.com/sirupsen/logrus"
@@ -60,25 +61,26 @@ func (r Runner) Run(ctx context.Context, scripts tasks.Scripts, globalAbortOnErr
6061
6162 changeMap := make (map [string ]string )
6263
63- if ! res . IsSkipped {
64- comment = `Command "` + name + `" run`
65- changeMap ["pid" ] = fmt .Sprintf ("%d" , res .Pid )
66- if runErr , ok := res .Err .(exec.RunError ); ok {
67- changeMap ["retcode" ] = fmt .Sprintf ("%d" , runErr .ExitCode )
68- }
64+ if cmdRunTask , ok := task .( * tasks. CmdRunTask ); ok {
65+ if ! res . IsSkipped {
66+ changeMap ["pid" ] = fmt .Sprintf ("%d" , res .Pid )
67+ if runErr , ok := res .Err .(exec.RunError ); ok {
68+ changeMap ["retcode" ] = fmt .Sprintf ("%d" , runErr .ExitCode )
69+ }
6970
70- changeMap ["stderr" ] = strings .TrimSpace (strings .ReplaceAll (res .StdErr , "\r \n " , "\n " ))
71- changeMap ["stdout" ] = strings .TrimSpace (strings .ReplaceAll (res .StdOut , "\r \n " , "\n " ))
71+ changeMap ["stderr" ] = strings .TrimSpace (strings .ReplaceAll (res .StdErr , "\r \n " , "\n " ))
72+ changeMap ["stdout" ] = strings .TrimSpace (strings .ReplaceAll (res .StdOut , "\r \n " , "\n " ))
7273
73- if exec .IsPowerShell (cmdRunTask .Shell ) {
74- changeMap ["stdout" ] = powershellUnquote (changeMap ["stdout" ])
74+ if exec .IsPowerShell (cmdRunTask .Shell ) {
75+ changeMap ["stdout" ] = powershellUnquote (changeMap ["stdout" ])
76+ }
77+ changes ++
7578 }
76- changes ++
77- }
7879
79- if cmdRunTask .AbortOnError && ! res .Succeeded () {
80- abort = true
81- aborted = total - tasksRun
80+ if cmdRunTask .AbortOnError && ! res .Succeeded () {
81+ abort = true
82+ aborted = total - tasksRun
83+ }
8284 }
8385
8486 if len (res .Changes ) > 0 {
0 commit comments