Added names and dirs outputs.
This commit is contained in:
@@ -50,9 +50,12 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
default: "${{ github.token }}"
|
default: "${{ github.token }}"
|
||||||
outputs:
|
outputs:
|
||||||
downloadedArtifacts:
|
downloadedArtifactNames:
|
||||||
description: "The downloaded artifacts."
|
description: "The downloaded artifacts names"
|
||||||
value: ${{ steps.download.outputs.downloadedArtifacts }}
|
value: ${{ steps.download.outputs.downloadedArtifactNames }}
|
||||||
|
downloadedArtifactPaths:
|
||||||
|
description: "The downloaded artifact paths."
|
||||||
|
value: ${{ steps.download.outputs.downloadedArtifactPaths }}
|
||||||
downloadedArtifactDirs:
|
downloadedArtifactDirs:
|
||||||
description: "The extracted downloaded artifact directories."
|
description: "The extracted downloaded artifact directories."
|
||||||
value: ${{ steps.download.outputs.downloadedArtifactDirs }}
|
value: ${{ steps.download.outputs.downloadedArtifactDirs }}
|
||||||
|
|||||||
@@ -121,8 +121,11 @@ if (artifactsToDownload.Length is 0)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StringBuilder namesBuilder = new();
|
||||||
|
namesBuilder.AppendLine("downloadedArtifactNames<<EOF");
|
||||||
|
|
||||||
StringBuilder artifactsBuilder = new();
|
StringBuilder artifactsBuilder = new();
|
||||||
artifactsBuilder.AppendLine("downloadedArtifacts<<EOF");
|
artifactsBuilder.AppendLine("downloadedArtifactPaths<<EOF");
|
||||||
|
|
||||||
StringBuilder artifactsDirsBuilder = new();
|
StringBuilder artifactsDirsBuilder = new();
|
||||||
artifactsDirsBuilder.AppendLine("downloadedArtifactDirs<<EOF");
|
artifactsDirsBuilder.AppendLine("downloadedArtifactDirs<<EOF");
|
||||||
@@ -150,7 +153,8 @@ foreach (ActionArtifact artifact in artifactsToDownload)
|
|||||||
fs.Close();
|
fs.Close();
|
||||||
|
|
||||||
Console.WriteLine($"Downloaded: {fileName}");
|
Console.WriteLine($"Downloaded: {fileName}");
|
||||||
artifactsBuilder.AppendLine(fileName);
|
namesBuilder.AppendLine(fileName);
|
||||||
|
artifactsBuilder.AppendLine(Path.GetFullPath(fileName));
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(unzipDir)) continue;
|
if (string.IsNullOrEmpty(unzipDir)) continue;
|
||||||
string fullUnzipDir = Path.Combine(unzipDir, artifact.Name);
|
string fullUnzipDir = Path.Combine(unzipDir, artifact.Name);
|
||||||
@@ -165,17 +169,21 @@ foreach (ActionArtifact artifact in artifactsToDownload)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namesBuilder.AppendLine("EOF");
|
||||||
artifactsBuilder.AppendLine("EOF");
|
artifactsBuilder.AppendLine("EOF");
|
||||||
artifactsDirsBuilder.AppendLine("EOF");
|
artifactsDirsBuilder.AppendLine("EOF");
|
||||||
|
|
||||||
string? githubOutput = configuration["GITHUB_OUTPUT"];
|
string? githubOutput = configuration["GITHUB_OUTPUT"];
|
||||||
if (!string.IsNullOrEmpty(githubOutput))
|
if (!string.IsNullOrEmpty(githubOutput))
|
||||||
{
|
{
|
||||||
|
await File.AppendAllTextAsync(githubOutput, namesBuilder.ToString());
|
||||||
await File.AppendAllTextAsync(githubOutput, artifactsBuilder.ToString());
|
await File.AppendAllTextAsync(githubOutput, artifactsBuilder.ToString());
|
||||||
await File.AppendAllTextAsync(githubOutput, artifactsDirsBuilder.ToString());
|
await File.AppendAllTextAsync(githubOutput, artifactsDirsBuilder.ToString());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Console.WriteLine(namesBuilder.ToString());
|
||||||
Console.WriteLine(artifactsBuilder.ToString());
|
Console.WriteLine(artifactsBuilder.ToString());
|
||||||
Console.WriteLine(artifactsDirsBuilder.ToString());
|
Console.WriteLine(artifactsDirsBuilder.ToString());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user