mirror of
https://github.com/actions/runner.git
synced 2025-12-10 20:36:49 +00:00
Try to simplify cleaning up file references
This commit is contained in:
@@ -359,8 +359,9 @@ namespace GitHub.Runner.Worker
|
|||||||
var stepSummaryFilePath = executionContext.GetGitHubContext("step_summary");
|
var stepSummaryFilePath = executionContext.GetGitHubContext("step_summary");
|
||||||
|
|
||||||
Trace.Info($"Reading step summary data from {stepSummaryFilePath}");
|
Trace.Info($"Reading step summary data from {stepSummaryFilePath}");
|
||||||
|
Trace.Info($"File exists: {stepSummaryFilePath} {File.Exists(stepSummaryFilePath)}");
|
||||||
|
|
||||||
var fileStream = new FileStream(stepSummaryFilePath, FileMode.Open, FileAccess.Read, FileShare.Read);
|
using (var fileStream = new FileStream(stepSummaryFilePath, FileMode.Open, FileAccess.Read, FileShare.Read))
|
||||||
using (var sr = new StreamReader(fileStream))
|
using (var sr = new StreamReader(fileStream))
|
||||||
{
|
{
|
||||||
Trace.Info($"Step summary data: {sr.ReadToEnd()}");
|
Trace.Info($"Step summary data: {sr.ReadToEnd()}");
|
||||||
@@ -375,9 +376,9 @@ namespace GitHub.Runner.Worker
|
|||||||
Directory.CreateDirectory(stepSummaryDirectory);
|
Directory.CreateDirectory(stepSummaryDirectory);
|
||||||
var stepSummaryFilePath = Path.Combine(stepSummaryDirectory, $"{Guid.NewGuid().ToString()}.md");
|
var stepSummaryFilePath = Path.Combine(stepSummaryDirectory, $"{Guid.NewGuid().ToString()}.md");
|
||||||
|
|
||||||
Trace.Info($"Using step summary file '{stepSummaryFilePath}'");
|
using (File.Create(stepSummaryFilePath)) {
|
||||||
var fileStream = File.Create(stepSummaryFilePath);
|
Trace.Info($"Using step summary file '{stepSummaryFilePath}'");
|
||||||
fileStream.Close();
|
}
|
||||||
|
|
||||||
return stepSummaryFilePath;
|
return stepSummaryFilePath;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user