Added outputs.
This commit is contained in:
@@ -49,14 +49,18 @@ inputs:
|
||||
description: "List of additional NuGet passwords to use."
|
||||
required: false
|
||||
default: "${{ github.token }}"
|
||||
# outputs:
|
||||
# query:
|
||||
# description: "The query result."
|
||||
# value: ${{ steps.query.outputs.console }}
|
||||
outputs:
|
||||
downloadedArtifacts:
|
||||
description: "The downloaded artifacts."
|
||||
value: ${{ steps.download.outputs.downloadedArtifacts }}
|
||||
downloadedArtifactDirs:
|
||||
description: "The extracted downloaded artifact directories."
|
||||
value: ${{ steps.download.outputs.downloadedArtifactDirs }}
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: "Download artifacts."
|
||||
id: download
|
||||
uses: act/common/dotnet/dotnet-10@master
|
||||
env:
|
||||
INPUTS: ${{ toJSON(inputs) }}
|
||||
|
||||
@@ -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