mirror of
https://github.com/actions/runner.git
synced 2025-12-13 00:36:29 +00:00
Add file length check
This commit is contained in:
@@ -63,7 +63,11 @@ namespace GitHub.Runner.Worker
|
|||||||
// Instead of using Regex which can be computationally expensive,
|
// Instead of using Regex which can be computationally expensive,
|
||||||
// we can just remove the # of characters from the fileName according to the length of the basePath
|
// we can just remove the # of characters from the fileName according to the length of the basePath
|
||||||
string basePath = _hostContext.GetDirectory(WellKnownDirectory.Actions);
|
string basePath = _hostContext.GetDirectory(WellKnownDirectory.Actions);
|
||||||
var fileName = manifestFile.Remove(0, basePath.Length + 1);
|
string fileName = manifestFile;
|
||||||
|
if (manifestFile.Length > basePath.Length + 1)
|
||||||
|
{
|
||||||
|
fileName = manifestFile.Remove(0, basePath.Length + 1);
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user