Added outputs.
This commit is contained in:
@@ -121,6 +121,11 @@ if (artifactsToDownload.Length is 0)
|
||||
return 1;
|
||||
}
|
||||
|
||||
StringBuilder artifactsBuilder = new();
|
||||
artifactsBuilder.AppendLine("downloadedArtifacts<<EOF");
|
||||
|
||||
StringBuilder artifactsDirsBuilder = new();
|
||||
artifactsDirsBuilder.AppendLine("downloadedArtifactDirs<<EOF");
|
||||
|
||||
Console.WriteLine("Downloading artifacts:");
|
||||
foreach (ActionArtifact artifact in artifactsToDownload)
|
||||
@@ -145,6 +150,7 @@ foreach (ActionArtifact artifact in artifactsToDownload)
|
||||
fs.Close();
|
||||
|
||||
Console.WriteLine($"Downloaded: {fileName}");
|
||||
artifactsBuilder.AppendLine(fileName);
|
||||
|
||||
if (string.IsNullOrEmpty(unzipDir)) continue;
|
||||
string fullUnzipDir = Path.Combine(unzipDir, artifact.Name);
|
||||
@@ -152,10 +158,25 @@ foreach (ActionArtifact artifact in artifactsToDownload)
|
||||
|
||||
Console.WriteLine($"Unzipping: {fileName} to {fullUnzipDir}");
|
||||
System.IO.Compression.ZipFile.ExtractToDirectory(fileName, fullUnzipDir, true);
|
||||
artifactsDirsBuilder.AppendLine(fullUnzipDir);
|
||||
if (deleteAfterUnzip)
|
||||
{
|
||||
File.Delete(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
artifactsBuilder.AppendLine("EOF");
|
||||
artifactsDirsBuilder.AppendLine("EOF");
|
||||
|
||||
string? githubOutput = configuration["GITHUB_OUTPUT"];
|
||||
if (!string.IsNullOrEmpty(githubOutput))
|
||||
{
|
||||
await File.AppendAllTextAsync(githubOutput, artifactsBuilder.ToString());
|
||||
await File.AppendAllTextAsync(githubOutput, artifactsDirsBuilder.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine(artifactsBuilder.ToString());
|
||||
Console.WriteLine(artifactsDirsBuilder.ToString());
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user