Skip to content

Commit

Permalink
fix some formatting issues with github summary report
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson committed Jan 29, 2023
1 parent 250835b commit 1ac8911
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
20 changes: 14 additions & 6 deletions Editor/Logging/GitHubActionsLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,29 +114,37 @@ public override void GenerateBuildSummary(BuildReport buildReport, Stopwatch sto

foreach (var message in step.messages)
{
summaryWriter.WriteLine($"| {message.type} | {message.content} |");
var logMessage = message.content.Replace("\n", string.Empty);
logMessage = logMessage.Replace(Error, string.Empty);
logMessage = logMessage.Replace(Warning, string.Empty);
logMessage = logMessage.Replace(ErrorColor, string.Empty);
logMessage = logMessage.Replace(WarningColor, string.Empty);
logMessage = logMessage.Replace(ResetColor, string.Empty);

summaryWriter.WriteLine($"| {message.type} | {logMessage} |");

switch (message.type)
{
case LogType.Error:
case LogType.Assert:
case LogType.Exception:
Debug.Log($"{Error}{ErrorColor}{message.content}{ResetColor}");
Debug.Log($"{Error}{ErrorColor}{logMessage}{ResetColor}");
break;
case LogType.Warning:
Debug.Log($"{Warning}{WarningColor}{message.content}{ResetColor}");
Debug.Log($"{Warning}{WarningColor}{logMessage}{ResetColor}");
break;
case LogType.Log:
Debug.Log($"{message.content}");
Debug.Log($"{logMessage}");
break;
default:
throw new ArgumentOutOfRangeException();
}
}

summaryWriter.WriteLine("</details>");
summaryWriter.WriteLine("");
}

summaryWriter.WriteLine("</details>");
summaryWriter.WriteLine("");
summaryWriter.Close();
summaryWriter.Dispose();
CILoggingUtility.LoggingEnabled = true;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Build Pipeline Utilities",
"description": "The Build Pipeline Utilities aims to give developers more tools and options when making builds with the command line or with continuous integration.",
"keywords": [],
"version": "1.1.2",
"version": "1.1.3",
"unity": "2019.4",
"license": "MIT",
"repository": {
Expand Down

0 comments on commit 1ac8911

Please sign in to comment.