1
0
Fork 0
mirror of https://code.forgejo.org/actions/download-artifact.git synced 2024-12-23 04:06:00 +01:00

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: outputs:
download-path: download-path:
description: 'Path of artifact download' description: 'Path of artifact download'
artifacts:
description: downloaded artifacts json array string
runs: runs:
using: 'node20' using: 'node20'
main: 'dist/index.js' main: 'dist/index.js'

2
dist/index.js vendored
View file

@ -120477,6 +120477,7 @@ var Inputs;
var Outputs; var Outputs;
(function (Outputs) { (function (Outputs) {
Outputs["DownloadPath"] = "download-path"; Outputs["DownloadPath"] = "download-path";
Outputs["Artifacts"] = "artifacts";
})(Outputs || (exports.Outputs = Outputs = {})); })(Outputs || (exports.Outputs = Outputs = {}));
@ -120612,6 +120613,7 @@ function run() {
} }
core.info(`Total of ${artifacts.length} artifact(s) downloaded`); core.info(`Total of ${artifacts.length} artifact(s) downloaded`);
core.setOutput(constants_1.Outputs.DownloadPath, resolvedPath); core.setOutput(constants_1.Outputs.DownloadPath, resolvedPath);
core.setOutput(constants_1.Outputs.Artifacts, JSON.stringify(artifacts));
core.info('Download artifact has finished successfully'); core.info('Download artifact has finished successfully');
}); });
} }

View file

@ -9,5 +9,6 @@ export enum Inputs {
} }
export enum Outputs { 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.info(`Total of ${artifacts.length} artifact(s) downloaded`)
core.setOutput(Outputs.DownloadPath, resolvedPath) core.setOutput(Outputs.DownloadPath, resolvedPath)
core.setOutput(Outputs.Artifacts, JSON.stringify(artifacts));
core.info('Download artifact has finished successfully') core.info('Download artifact has finished successfully')
} }