Added names and dirs outputs.

This commit is contained in:
2025-07-10 14:05:13 -07:00
parent b0980a13ab
commit 5162240176
2 changed files with 16 additions and 5 deletions

View File

@@ -50,9 +50,12 @@ inputs:
required: false
default: "${{ github.token }}"
outputs:
downloadedArtifacts:
description: "The downloaded artifacts."
value: ${{ steps.download.outputs.downloadedArtifacts }}
downloadedArtifactNames:
description: "The downloaded artifacts names"
value: ${{ steps.download.outputs.downloadedArtifactNames }}
downloadedArtifactPaths:
description: "The downloaded artifact paths."
value: ${{ steps.download.outputs.downloadedArtifactPaths }}
downloadedArtifactDirs:
description: "The extracted downloaded artifact directories."
value: ${{ steps.download.outputs.downloadedArtifactDirs }}

View File

@@ -121,8 +121,11 @@ if (artifactsToDownload.Length is 0)
return 1;
}
StringBuilder namesBuilder = new();
namesBuilder.AppendLine("downloadedArtifactNames<<EOF");
StringBuilder artifactsBuilder = new();
artifactsBuilder.AppendLine("downloadedArtifacts<<EOF");
artifactsBuilder.AppendLine("downloadedArtifactPaths<<EOF");
StringBuilder artifactsDirsBuilder = new();
artifactsDirsBuilder.AppendLine("downloadedArtifactDirs<<EOF");
@@ -150,7 +153,8 @@ foreach (ActionArtifact artifact in artifactsToDownload)
fs.Close();
Console.WriteLine($"Downloaded: {fileName}");
artifactsBuilder.AppendLine(fileName);
namesBuilder.AppendLine(fileName);
artifactsBuilder.AppendLine(Path.GetFullPath(fileName));
if (string.IsNullOrEmpty(unzipDir)) continue;
string fullUnzipDir = Path.Combine(unzipDir, artifact.Name);
@@ -165,17 +169,21 @@ foreach (ActionArtifact artifact in artifactsToDownload)
}
}
namesBuilder.AppendLine("EOF");
artifactsBuilder.AppendLine("EOF");
artifactsDirsBuilder.AppendLine("EOF");
string? githubOutput = configuration["GITHUB_OUTPUT"];
if (!string.IsNullOrEmpty(githubOutput))
{
await File.AppendAllTextAsync(githubOutput, namesBuilder.ToString());
await File.AppendAllTextAsync(githubOutput, artifactsBuilder.ToString());
await File.AppendAllTextAsync(githubOutput, artifactsDirsBuilder.ToString());
}
else
{
Console.WriteLine(namesBuilder.ToString());
Console.WriteLine(artifactsBuilder.ToString());
Console.WriteLine(artifactsDirsBuilder.ToString());
}