Update dist/index.js

This commit is contained in:
Matthias Valvekens 2023-12-18 00:12:32 +01:00
parent 15051941e0
commit 7dec35858a
No known key found for this signature in database
GPG key ID: 15F42BEFA159BA54

17
dist/index.js vendored
View file

@ -120962,6 +120962,7 @@ exports.Outputs = exports.Inputs = void 0;
var Inputs;
(function (Inputs) {
Inputs["Name"] = "name";
Inputs["NamePrefix"] = "name-prefix";
Inputs["Path"] = "path";
Inputs["GitHubToken"] = "github-token";
Inputs["Repository"] = "repository";
@ -121028,6 +121029,7 @@ function run() {
return __awaiter(this, void 0, void 0, function* () {
const inputs = {
name: core.getInput(constants_1.Inputs.Name, { required: false }),
namePrefix: core.getInput(constants_1.Inputs.NamePrefix, { required: false }),
path: core.getInput(constants_1.Inputs.Path, { required: false }),
token: core.getInput(constants_1.Inputs.GitHubToken, { required: false }),
repository: core.getInput(constants_1.Inputs.Repository, { required: false }),
@ -121066,13 +121068,22 @@ function run() {
artifacts = [targetArtifact];
}
else {
core.info(`No input name specified, downloading all artifacts. Extra directory with the artifact name will be created for each download`);
core.info(`No input name specified, downloading all artifacts ${inputs.namePrefix ? `starting with '${inputs.namePrefix}'` : ''}.
Extra directory with the artifact name will be created for each download`);
const listArtifactResponse = yield artifact_1.default.listArtifacts(Object.assign({ latest: true }, options));
if (listArtifactResponse.artifacts.length === 0) {
throw new Error(`No artifacts found for run '${inputs.runID}' in '${inputs.repository}'`);
}
core.debug(`Found ${listArtifactResponse.artifacts.length} artifacts`);
artifacts = listArtifactResponse.artifacts;
if (inputs.namePrefix) {
artifacts = listArtifactResponse.artifacts.filter(art => art.name.startsWith(inputs.namePrefix));
if (artifacts.length === 0) {
throw new Error(`No artifacts found starting with prefix ${inputs.namePrefix} for run '${inputs.runID}' in '${inputs.repository}'`);
}
}
else {
artifacts = listArtifactResponse.artifacts;
}
core.debug(`Found ${artifacts.length} artifacts`);
}
const downloadPromises = artifacts.map(artifact => artifact_1.default.downloadArtifact(artifact.id, Object.assign(Object.assign({}, options), { path: isSingleArtifactDownload
? resolvedPath