File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -241,8 +241,12 @@ func auditLogDescription(alog database.GetAuditLogsOffsetRow, additionalFields A
241
241
// where target is a workspace instead of a workspace build
242
242
// passed in on the FE via AuditLog.AdditionalFields rather than derived in request.go:35
243
243
if alog .ResourceType == database .ResourceTypeWorkspaceBuild && alog .Action != database .AuditActionDelete {
244
- str += fmt .Sprintf (" build #%s for" ,
245
- additionalFields .BuildNumber )
244
+ if len (additionalFields .BuildNumber ) == 0 {
245
+ str += " build for"
246
+ } else {
247
+ str += fmt .Sprintf (" build #%s for" ,
248
+ additionalFields .BuildNumber )
249
+ }
246
250
}
247
251
248
252
// We don't display the name (target) for git ssh keys. It's fairly long and doesn't
@@ -324,6 +328,9 @@ func auditLogResourceLink(alog database.GetAuditLogsOffsetRow, additionalFields
324
328
return fmt .Sprintf ("/@%s/%s" ,
325
329
alog .UserUsername .String , alog .ResourceTarget )
326
330
case database .ResourceTypeWorkspaceBuild :
331
+ if len (additionalFields .WorkspaceName ) == 0 || len (additionalFields .BuildNumber ) == 0 {
332
+ return ""
333
+ }
327
334
return fmt .Sprintf ("/@%s/%s/builds/%s" ,
328
335
alog .UserUsername .String , additionalFields .WorkspaceName , additionalFields .BuildNumber )
329
336
default :
You can’t perform that action at this time.
0 commit comments