Save original, pre-parsed string from workflow input for the user's custom volume mounts (#1889)

* Save pre parsed string from workflow input for volume mounts that have one

* Use property

* Use named params
This commit is contained in:
Ferenc Hammerl
2022-05-23 12:07:38 +02:00
committed by GitHub
parent 5cca207314
commit 88ee16fb02
2 changed files with 25 additions and 17 deletions

View File

@@ -192,13 +192,12 @@ namespace GitHub.Runner.Worker
{
Trace.Info($"User provided port: {port.Value}");
}
foreach (var volume in container.UserMountVolumes)
foreach (var mount in container.UserMountVolumes)
{
Trace.Info($"User provided volume: {volume.Value}");
var mount = new MountVolume(volume.Value);
Trace.Info($"User provided volume: {mount.UserProvidedValue}");
if (string.Equals(mount.SourceVolumePath, "/", StringComparison.OrdinalIgnoreCase))
{
executionContext.Warning($"Volume mount {volume.Value} is going to mount '/' into the container which may cause file ownership change in the entire file system and cause Actions Runner to lose permission to access the disk.");
executionContext.Warning($"Volume mount {mount.UserProvidedValue} is going to mount '/' into the container which may cause file ownership change in the entire file system and cause Actions Runner to lose permission to access the disk.");
}
}