mirror of
https://github.com/actions/runner.git
synced 2025-12-11 12:57:05 +00:00
* Revert "remove issue generation on warning/error commands (#137)"
This reverts commit 53da198867.
* Updated Release notes
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
- N/A
|
- N/A
|
||||||
|
|
||||||
## Bugs
|
## Bugs
|
||||||
- N/A
|
- Reverted removal of additional fields error and warning fields (#147)
|
||||||
|
|
||||||
## Misc
|
## Misc
|
||||||
- Updated to .NET Core 3.0 (#127)
|
- Updated to .NET Core 3.0 (#127)
|
||||||
|
|||||||
@@ -441,6 +441,9 @@ namespace GitHub.Runner.Worker
|
|||||||
public void ProcessCommand(IExecutionContext context, string inputLine, ActionCommand command, out bool omitEcho)
|
public void ProcessCommand(IExecutionContext context, string inputLine, ActionCommand command, out bool omitEcho)
|
||||||
{
|
{
|
||||||
omitEcho = true;
|
omitEcho = true;
|
||||||
|
command.Properties.TryGetValue(IssueCommandProperties.File, out string file);
|
||||||
|
command.Properties.TryGetValue(IssueCommandProperties.Line, out string line);
|
||||||
|
command.Properties.TryGetValue(IssueCommandProperties.Column, out string column);
|
||||||
|
|
||||||
Issue issue = new Issue()
|
Issue issue = new Issue()
|
||||||
{
|
{
|
||||||
@@ -449,8 +452,54 @@ namespace GitHub.Runner.Worker
|
|||||||
Message = command.Data
|
Message = command.Data
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(file))
|
||||||
|
{
|
||||||
|
issue.Category = "Code";
|
||||||
|
|
||||||
|
if (context.Container != null)
|
||||||
|
{
|
||||||
|
// Translate file path back from container path
|
||||||
|
file = context.Container.TranslateToHostPath(file);
|
||||||
|
command.Properties[IssueCommandProperties.File] = file;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the values that represent the server path given a local path
|
||||||
|
string repoName = context.GetGitHubContext("repository");
|
||||||
|
var repoPath = context.GetGitHubContext("workspace");
|
||||||
|
|
||||||
|
string relativeSourcePath = IOUtil.MakeRelative(file, repoPath);
|
||||||
|
if (!string.Equals(relativeSourcePath, file, IOUtil.FilePathStringComparison))
|
||||||
|
{
|
||||||
|
// add repo info
|
||||||
|
if (!string.IsNullOrEmpty(repoName))
|
||||||
|
{
|
||||||
|
command.Properties["repo"] = repoName;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(relativeSourcePath))
|
||||||
|
{
|
||||||
|
// replace sourcePath with the new relative path
|
||||||
|
// prefer `/` on all platforms
|
||||||
|
command.Properties[IssueCommandProperties.File] = relativeSourcePath.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var property in command.Properties)
|
||||||
|
{
|
||||||
|
issue.Data[property.Key] = property.Value;
|
||||||
|
}
|
||||||
|
|
||||||
context.AddIssue(issue);
|
context.AddIssue(issue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static class IssueCommandProperties
|
||||||
|
{
|
||||||
|
public const String File = "file";
|
||||||
|
public const String Line = "line";
|
||||||
|
public const String Column = "col";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class GroupCommandExtension : GroupingCommandExtension
|
public sealed class GroupCommandExtension : GroupingCommandExtension
|
||||||
|
|||||||
Reference in New Issue
Block a user