mirror of
https://github.com/actions/runner.git
synced 2025-12-10 12:36:23 +00:00
* Re-add file size check prior to reading file * Remove redundant file size check
This commit is contained in:
@@ -182,6 +182,14 @@ namespace GitHub.Runner.Worker
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fileSize > AttachmentSizeLimit)
|
||||||
|
{
|
||||||
|
context.Error(String.Format(Constants.Runner.UnsupportedSummarySize, AttachmentSizeLimit / 1024, fileSize / 1024));
|
||||||
|
Trace.Info($"Step Summary file ({filePath}) is too large ({fileSize} bytes); skipping attachment upload");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Trace.Verbose($"Step Summary file exists: {filePath} and has a file size of {fileSize} bytes");
|
Trace.Verbose($"Step Summary file exists: {filePath} and has a file size of {fileSize} bytes");
|
||||||
var scrubbedFilePath = filePath + "-scrubbed";
|
var scrubbedFilePath = filePath + "-scrubbed";
|
||||||
|
|
||||||
@@ -210,14 +218,6 @@ namespace GitHub.Runner.Worker
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (fileSize > AttachmentSizeLimit)
|
|
||||||
{
|
|
||||||
context.Error(String.Format(Constants.Runner.UnsupportedSummarySize, AttachmentSizeLimit / 1024, fileSize / 1024));
|
|
||||||
Trace.Info($"Step Summary file ({filePath}) is too large ({fileSize} bytes); skipping attachment upload");
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Trace.Info($"Queueing file ({filePath}) for attachment upload ({attachmentName})");
|
Trace.Info($"Queueing file ({filePath}) for attachment upload ({attachmentName})");
|
||||||
// Attachments must be added to the parent context (job), not the current context (step)
|
// Attachments must be added to the parent context (job), not the current context (step)
|
||||||
context.Root.QueueAttachFile(ChecksAttachmentType.StepSummary, attachmentName, scrubbedFilePath);
|
context.Root.QueueAttachFile(ChecksAttachmentType.StepSummary, attachmentName, scrubbedFilePath);
|
||||||
|
|||||||
Reference in New Issue
Block a user