From 5a52bf4756355f118dcbe978a2f8c2bf0f0fc0a9 Mon Sep 17 00:00:00 2001 From: phuong Date: Fri, 20 Sep 2024 17:14:36 +0700 Subject: [PATCH] Set Output downloaded artifacts (json string) --- action.yml | 2 ++ dist/index.js | 2 ++ src/constants.ts | 3 ++- src/download-artifact.ts | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 54a3eb6..08e3727 100644 --- a/action.yml +++ b/action.yml @@ -35,6 +35,8 @@ inputs: outputs: download-path: description: 'Path of artifact download' + artifacts: + description: downloaded artifacts json array string runs: using: 'node20' main: 'dist/index.js' diff --git a/dist/index.js b/dist/index.js index facc756..f63d542 100644 --- a/dist/index.js +++ b/dist/index.js @@ -120477,6 +120477,7 @@ var Inputs; var Outputs; (function (Outputs) { Outputs["DownloadPath"] = "download-path"; + Outputs["Artifacts"] = "artifacts"; })(Outputs || (exports.Outputs = Outputs = {})); @@ -120612,6 +120613,7 @@ function run() { } core.info(`Total of ${artifacts.length} artifact(s) downloaded`); core.setOutput(constants_1.Outputs.DownloadPath, resolvedPath); + core.setOutput(constants_1.Outputs.Artifacts, JSON.stringify(artifacts)); core.info('Download artifact has finished successfully'); }); } diff --git a/src/constants.ts b/src/constants.ts index 17c7d34..a91c568 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -9,5 +9,6 @@ export enum Inputs { } export enum Outputs { - DownloadPath = 'download-path' + DownloadPath = 'download-path', + Artifacts = 'artifacts', } diff --git a/src/download-artifact.ts b/src/download-artifact.ts index aedfe12..e31cf89 100644 --- a/src/download-artifact.ts +++ b/src/download-artifact.ts @@ -128,6 +128,7 @@ async function run(): Promise { core.info(`Total of ${artifacts.length} artifact(s) downloaded`) core.setOutput(Outputs.DownloadPath, resolvedPath) + core.setOutput(Outputs.Artifacts, JSON.stringify(artifacts)); core.info('Download artifact has finished successfully') }