Set Output downloaded artifacts (json string)

This commit is contained in:
phuong 2024-09-20 17:14:36 +07:00
parent fa0a91b85d
commit 5a52bf4756
4 changed files with 7 additions and 1 deletions

View File

@ -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'

2
dist/index.js vendored
View File

@ -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');
});
}

View File

@ -9,5 +9,6 @@ export enum Inputs {
}
export enum Outputs {
DownloadPath = 'download-path'
DownloadPath = 'download-path',
Artifacts = 'artifacts',
}

View File

@ -128,6 +128,7 @@ async function run(): Promise<void> {
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')
}