mirror of
https://github.com/actions/download-artifact.git
synced 2025-07-25 07:58:33 +02:00
Update dist/index.js
This commit is contained in:
parent
15051941e0
commit
7dec35858a
1 changed files with 14 additions and 3 deletions
17
dist/index.js
vendored
17
dist/index.js
vendored
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue