@@ -16,8 +16,27 @@ type LogLine = {
16
16
message: string ;
17
17
};
18
18
19
- const LogLinePrefixGroup = ' ::group::' ;
20
- const LogLinePrefixEndGroup = ' ::endgroup::' ;
19
+ const LogLinePrefixesGroup = [' ::group::' , ' ##[group]' ];
20
+ const LogLinePrefixesEndGroup = [' ::endgroup::' , ' ##[endgroup]' ];
21
+
22
+ type LogLineCommand = {
23
+ name: ' group' | ' endgroup' ,
24
+ prefix: string ,
25
+ }
26
+
27
+ function parseLineCommand(line : LogLine ): LogLineCommand | null {
28
+ for (const prefix of LogLinePrefixesGroup ) {
29
+ if (line .message .startsWith (prefix )) {
30
+ return {name: ' group' , prefix };
31
+ }
32
+ }
33
+ for (const prefix of LogLinePrefixesEndGroup ) {
34
+ if (line .message .startsWith (prefix )) {
35
+ return {name: ' endgroup' , prefix };
36
+ }
37
+ }
38
+ return null ;
39
+ }
21
40
22
41
const sfc = {
23
42
name: ' RepoActionView' ,
@@ -123,19 +142,20 @@ const sfc = {
123
142
},
124
143
125
144
methods: {
145
+
126
146
// get the active container element, either the `job-step-logs` or the `job-log-list` in the `job-log-group`
127
147
getLogsContainer(stepIndex : number ) {
128
148
const el = this .$refs .logs [stepIndex ];
129
149
return el ._stepLogsActiveContainer ?? el ;
130
150
},
131
151
// begin a log group
132
- beginLogGroup(stepIndex : number , startTime : number , line : LogLine ) {
152
+ beginLogGroup(stepIndex : number , startTime : number , line : LogLine , cmd : LogLineCommand ) {
133
153
const el = this .$refs .logs [stepIndex ];
134
154
const elJobLogGroupSummary = createElementFromAttrs (' summary' , {class: ' job-log-group-summary' },
135
155
this .createLogLine (stepIndex , startTime , {
136
156
index: line .index ,
137
157
timestamp: line .timestamp ,
138
- message: line .message .substring (LogLinePrefixGroup .length ),
158
+ message: line .message .substring (cmd . prefix .length ),
139
159
}),
140
160
);
141
161
const elJobLogList = createElementFromAttrs (' div' , {class: ' job-log-list' });
@@ -147,13 +167,13 @@ const sfc = {
147
167
el ._stepLogsActiveContainer = elJobLogList ;
148
168
},
149
169
// end a log group
150
- endLogGroup(stepIndex : number , startTime : number , line : LogLine ) {
170
+ endLogGroup(stepIndex : number , startTime : number , line : LogLine , cmd : LogLineCommand ) {
151
171
const el = this .$refs .logs [stepIndex ];
152
172
el ._stepLogsActiveContainer = null ;
153
173
el .append (this .createLogLine (stepIndex , startTime , {
154
174
index: line .index ,
155
175
timestamp: line .timestamp ,
156
- message: line .message .substring (LogLinePrefixEndGroup .length ),
176
+ message: line .message .substring (cmd . prefix .length ),
157
177
}));
158
178
},
159
179
@@ -201,11 +221,12 @@ const sfc = {
201
221
appendLogs(stepIndex : number , startTime : number , logLines : LogLine []) {
202
222
for (const line of logLines ) {
203
223
const el = this .getLogsContainer (stepIndex );
204
- if (line .message .startsWith (LogLinePrefixGroup )) {
205
- this .beginLogGroup (stepIndex , startTime , line );
224
+ const cmd = parseLineCommand (line );
225
+ if (cmd ?.name === ' group' ) {
226
+ this .beginLogGroup (stepIndex , startTime , line , cmd );
206
227
continue ;
207
- } else if (line . message . startsWith ( LogLinePrefixEndGroup ) ) {
208
- this .endLogGroup (stepIndex , startTime , line );
228
+ } else if (cmd ?. name === ' endgroup ' ) {
229
+ this .endLogGroup (stepIndex , startTime , line , cmd );
209
230
continue ;
210
231
}
211
232
el .append (this .createLogLine (stepIndex , startTime , line ));
@@ -393,7 +414,7 @@ export function initRepositoryActionView() {
393
414
<button class =" ui basic small compact button red" @click =" cancelRun()" v-else-if =" run.canCancel" >
394
415
{{ locale.cancel }}
395
416
</button >
396
- <button class =" ui basic small compact button tw-mr-0 tw-whitespace-nowrap link-action" :data-url =" `${run.link}/rerun`" v-else-if =" run.canRerun" >
417
+ <button class =" ui basic small compact button link-action" :data-url =" `${run.link}/rerun`" v-else-if =" run.canRerun" >
397
418
{{ locale.rerun_all }}
398
419
</button >
399
420
</div >
@@ -539,6 +560,11 @@ export function initRepositoryActionView() {
539
560
overflow-wrap : anywhere;
540
561
}
541
562
563
+ .action-info-summary .ui.button {
564
+ margin : 0 ;
565
+ white-space : nowrap ;
566
+ }
567
+
542
568
.action-commit-summary {
543
569
display : flex ;
544
570
flex-wrap : wrap ;
0 commit comments