mirror of
https://github.com/actions/runner.git
synced 2025-12-11 04:46:58 +00:00
Only add StepResult for Tasks, not the Job itself (#2620)
This commit is contained in:
@@ -477,28 +477,32 @@ namespace GitHub.Runner.Worker
|
|||||||
|
|
||||||
PublishStepTelemetry();
|
PublishStepTelemetry();
|
||||||
|
|
||||||
var stepResult = new StepResult
|
if (_record.RecordType == "Task")
|
||||||
{
|
{
|
||||||
ExternalID = _record.Id,
|
var stepResult = new StepResult
|
||||||
Conclusion = _record.Result ?? TaskResult.Succeeded,
|
|
||||||
Status = _record.State,
|
|
||||||
Number = _record.Order,
|
|
||||||
Name = _record.Name,
|
|
||||||
StartedAt = _record.StartTime,
|
|
||||||
CompletedAt = _record.FinishTime,
|
|
||||||
Annotations = new List<Annotation>()
|
|
||||||
};
|
|
||||||
|
|
||||||
_record.Issues?.ForEach(issue =>
|
|
||||||
{
|
|
||||||
var annotation = issue.ToAnnotation();
|
|
||||||
if (annotation != null)
|
|
||||||
{
|
{
|
||||||
stepResult.Annotations.Add(annotation.Value);
|
ExternalID = _record.Id,
|
||||||
}
|
Conclusion = _record.Result ?? TaskResult.Succeeded,
|
||||||
});
|
Status = _record.State,
|
||||||
|
Number = _record.Order,
|
||||||
|
Name = _record.Name,
|
||||||
|
StartedAt = _record.StartTime,
|
||||||
|
CompletedAt = _record.FinishTime,
|
||||||
|
Annotations = new List<Annotation>()
|
||||||
|
};
|
||||||
|
|
||||||
|
_record.Issues?.ForEach(issue =>
|
||||||
|
{
|
||||||
|
var annotation = issue.ToAnnotation();
|
||||||
|
if (annotation != null)
|
||||||
|
{
|
||||||
|
stepResult.Annotations.Add(annotation.Value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Global.StepsResult.Add(stepResult);
|
||||||
|
}
|
||||||
|
|
||||||
Global.StepsResult.Add(stepResult);
|
|
||||||
|
|
||||||
if (Root != this)
|
if (Root != this)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -821,8 +821,7 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
ec.Complete();
|
ec.Complete();
|
||||||
|
|
||||||
// Assert.
|
// Assert.
|
||||||
Assert.Equal(1, ec.Global.StepsResult.Count);
|
Assert.Equal(0, ec.Global.StepsResult.Count);
|
||||||
Assert.Equal(TaskResult.Succeeded, ec.Global.StepsResult.Single().Conclusion);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user