9
9
)
10
10
11
11
var commandPatternGA * regexp.Regexp
12
+
12
13
var commandPatternADO * regexp.Regexp
13
14
14
15
func init () {
@@ -41,7 +42,9 @@ func (rc *RunContext) commandHandler(ctx context.Context) common.LineHandler {
41
42
}
42
43
43
44
if resumeCommand != "" && command != resumeCommand {
44
- logger .Infof (" \U00002699 %s" , line )
45
+ // There should not be any emojis in the log output for Gitea.
46
+ // The code in the switch statement is the same.
47
+ logger .Infof ("%s" , line )
45
48
return false
46
49
}
47
50
arg = unescapeCommandData (arg )
@@ -54,27 +57,27 @@ func (rc *RunContext) commandHandler(ctx context.Context) common.LineHandler {
54
57
case "add-path" :
55
58
rc .addPath (ctx , arg )
56
59
case "debug" :
57
- logger .Infof (" \U0001F4AC %s" , line )
60
+ logger .Infof ("%s" , line )
58
61
case "warning" :
59
- logger .Infof (" \U0001F6A7 %s" , line )
62
+ logger .Infof ("%s" , line )
60
63
case "error" :
61
- logger .Infof (" \U00002757 %s" , line )
64
+ logger .Infof ("%s" , line )
62
65
case "add-mask" :
63
66
rc .AddMask (arg )
64
- logger .Infof (" \U00002699 %s" , "***" )
67
+ logger .Infof ("%s" , "***" )
65
68
case "stop-commands" :
66
69
resumeCommand = arg
67
- logger .Infof (" \U00002699 %s" , line )
70
+ logger .Infof ("%s" , line )
68
71
case resumeCommand :
69
72
resumeCommand = ""
70
- logger .Infof (" \U00002699 %s" , line )
73
+ logger .Infof ("%s" , line )
71
74
case "save-state" :
72
- logger .Infof (" \U0001f4be %s" , line )
75
+ logger .Infof ("%s" , line )
73
76
rc .saveState (ctx , kvPairs , arg )
74
77
case "add-matcher" :
75
- logger .Infof (" \U00002753 add-matcher %s" , arg )
78
+ logger .Infof ("%s" , line )
76
79
default :
77
- logger .Infof (" \U00002753 %s" , line )
80
+ logger .Infof ("%s" , line )
78
81
}
79
82
80
83
// return true to let gitea's logger handle these special outputs also
@@ -84,7 +87,7 @@ func (rc *RunContext) commandHandler(ctx context.Context) common.LineHandler {
84
87
85
88
func (rc * RunContext ) setEnv (ctx context.Context , kvPairs map [string ]string , arg string ) {
86
89
name := kvPairs ["name" ]
87
- common .Logger (ctx ).Infof (" \U00002699 ::set-env:: %s=%s" , name , arg )
90
+ common .Logger (ctx ).Infof ("::set-env:: %s=%s" , name , arg )
88
91
if rc .Env == nil {
89
92
rc .Env = make (map [string ]string )
90
93
}
@@ -101,6 +104,7 @@ func (rc *RunContext) setEnv(ctx context.Context, kvPairs map[string]string, arg
101
104
mergeIntoMap (rc .Env , newenv )
102
105
mergeIntoMap (rc .GlobalEnv , newenv )
103
106
}
107
+
104
108
func (rc * RunContext ) setOutput (ctx context.Context , kvPairs map [string ]string , arg string ) {
105
109
logger := common .Logger (ctx )
106
110
stepID := rc .CurrentStep
@@ -116,11 +120,12 @@ func (rc *RunContext) setOutput(ctx context.Context, kvPairs map[string]string,
116
120
return
117
121
}
118
122
119
- logger .Infof (" \U00002699 ::set-output:: %s=%s" , outputName , arg )
123
+ logger .Infof ("::set-output:: %s=%s" , outputName , arg )
120
124
result .Outputs [outputName ] = arg
121
125
}
126
+
122
127
func (rc * RunContext ) addPath (ctx context.Context , arg string ) {
123
- common .Logger (ctx ).Infof (" \U00002699 ::add-path:: %s" , arg )
128
+ common .Logger (ctx ).Infof ("::add-path:: %s" , arg )
124
129
extraPath := []string {arg }
125
130
for _ , v := range rc .ExtraPath {
126
131
if v != arg {
@@ -141,6 +146,7 @@ func parseKeyValuePairs(kvPairs string, separator string) map[string]string {
141
146
}
142
147
return rtn
143
148
}
149
+
144
150
func unescapeCommandData (arg string ) string {
145
151
escapeMap := map [string ]string {
146
152
"%25" : "%" ,
@@ -152,6 +158,7 @@ func unescapeCommandData(arg string) string {
152
158
}
153
159
return arg
154
160
}
161
+
155
162
func unescapeCommandProperty (arg string ) string {
156
163
escapeMap := map [string ]string {
157
164
"%25" : "%" ,
@@ -165,6 +172,7 @@ func unescapeCommandProperty(arg string) string {
165
172
}
166
173
return arg
167
174
}
175
+
168
176
func unescapeKvPairs (kvPairs map [string ]string ) map [string ]string {
169
177
for k , v := range kvPairs {
170
178
kvPairs [k ] = unescapeCommandProperty (v )
0 commit comments