File tree 1 file changed +22
-1
lines changed
1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package task_logger
2
2
3
3
import (
4
4
"os/exec"
5
+ "strings"
5
6
"time"
6
7
)
7
8
@@ -20,6 +21,24 @@ const (
20
21
TaskFailStatus TaskStatus = "error"
21
22
)
22
23
24
+ func (s TaskStatus ) String () string {
25
+ switch s {
26
+ case TaskWaitingStatus ,
27
+ TaskStartingStatus ,
28
+ TaskWaitingConfirmation ,
29
+ TaskConfirmed ,
30
+ TaskRejected ,
31
+ TaskRunningStatus ,
32
+ TaskStoppingStatus ,
33
+ TaskStoppedStatus ,
34
+ TaskSuccessStatus ,
35
+ TaskFailStatus :
36
+ return string (s )
37
+ default :
38
+ return "unknown"
39
+ }
40
+ }
41
+
23
42
func (s TaskStatus ) IsValid () bool {
24
43
switch s {
25
44
case TaskWaitingStatus ,
@@ -55,8 +74,10 @@ func (s TaskStatus) Format() (res string) {
55
74
default :
56
75
res += "❓"
57
76
}
77
+
58
78
// to avoid email content injection issue
59
- //res += strings.ToUpper(string(s))
79
+ res += strings .ToUpper (s .String ())
80
+
60
81
return
61
82
}
62
83
You can’t perform that action at this time.
0 commit comments