mirror of
https://github.com/actions/download-artifact.git
synced 2025-07-27 00:48:28 +02:00
Update dist/index.js
This commit is contained in:
parent
15051941e0
commit
7dec35858a
1 changed files with 14 additions and 3 deletions
15
dist/index.js
vendored
15
dist/index.js
vendored
|
@ -120962,6 +120962,7 @@ exports.Outputs = exports.Inputs = void 0;
|
||||||
var Inputs;
|
var Inputs;
|
||||||
(function (Inputs) {
|
(function (Inputs) {
|
||||||
Inputs["Name"] = "name";
|
Inputs["Name"] = "name";
|
||||||
|
Inputs["NamePrefix"] = "name-prefix";
|
||||||
Inputs["Path"] = "path";
|
Inputs["Path"] = "path";
|
||||||
Inputs["GitHubToken"] = "github-token";
|
Inputs["GitHubToken"] = "github-token";
|
||||||
Inputs["Repository"] = "repository";
|
Inputs["Repository"] = "repository";
|
||||||
|
@ -121028,6 +121029,7 @@ function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const inputs = {
|
const inputs = {
|
||||||
name: core.getInput(constants_1.Inputs.Name, { required: false }),
|
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 }),
|
path: core.getInput(constants_1.Inputs.Path, { required: false }),
|
||||||
token: core.getInput(constants_1.Inputs.GitHubToken, { required: false }),
|
token: core.getInput(constants_1.Inputs.GitHubToken, { required: false }),
|
||||||
repository: core.getInput(constants_1.Inputs.Repository, { required: false }),
|
repository: core.getInput(constants_1.Inputs.Repository, { required: false }),
|
||||||
|
@ -121066,14 +121068,23 @@ function run() {
|
||||||
artifacts = [targetArtifact];
|
artifacts = [targetArtifact];
|
||||||
}
|
}
|
||||||
else {
|
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));
|
const listArtifactResponse = yield artifact_1.default.listArtifacts(Object.assign({ latest: true }, options));
|
||||||
if (listArtifactResponse.artifacts.length === 0) {
|
if (listArtifactResponse.artifacts.length === 0) {
|
||||||
throw new Error(`No artifacts found for run '${inputs.runID}' in '${inputs.repository}'`);
|
throw new Error(`No artifacts found for run '${inputs.runID}' in '${inputs.repository}'`);
|
||||||
}
|
}
|
||||||
core.debug(`Found ${listArtifactResponse.artifacts.length} 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;
|
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
|
const downloadPromises = artifacts.map(artifact => artifact_1.default.downloadArtifact(artifact.id, Object.assign(Object.assign({}, options), { path: isSingleArtifactDownload
|
||||||
? resolvedPath
|
? resolvedPath
|
||||||
: path.join(resolvedPath, artifact.name) })));
|
: path.join(resolvedPath, artifact.name) })));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue