Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Cake.AzurePipelines.Module/AzurePipelinesReportPrinter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ private void WriteToMarkdown(CakeReport report)
sb.AppendLine("|:---|-------:|:-----|");
}

var targetName = string.Empty;
foreach (var item in report)
{
if (ShouldWriteTask(item))
Expand All @@ -96,9 +97,11 @@ private void WriteToMarkdown(CakeReport report)
sb.AppendLine(string.Format(lineFormat, item.TaskName, FormatDuration(item), item.ExecutionStatus.ToReportStatus()));
}
}

targetName = item.TaskName; // Use the last task name it is the target name
}

sb.AppendLine("");
sb.AppendLine(string.Empty);
var b = _context.BuildSystem().AzurePipelines;
FilePath agentWorkPath = b.Environment.Build.ArtifactStagingDirectory + "/tasksummary.md";
var absFilePath = agentWorkPath.MakeAbsolute(_context.Environment);
Expand All @@ -108,7 +111,7 @@ private void WriteToMarkdown(CakeReport report)
writer.Write(sb.ToString());
}

_console.WriteLine($"##vso[task.addattachment type=Distributedtask.Core.Summary;name=Cake Build Summary;]{absFilePath.MakeAbsolute(_context.Environment).FullPath}");
_console.WriteLine($"##vso[task.addattachment type=Distributedtask.Core.Summary;name=Cake {targetName} Build Summary;]{absFilePath.MakeAbsolute(_context.Environment).FullPath}");
}
}
}
Loading