mirror of
https://github.com/actions/download-artifact.git
synced 2025-07-19 21:18:26 +02:00
Merge fd6355b2d3
into 448e3f862a
This commit is contained in:
commit
55654a4b9a
2 changed files with 23 additions and 26 deletions
19
dist/index.js
vendored
19
dist/index.js
vendored
|
@ -118881,16 +118881,15 @@ function run() {
|
|||
core.info(`- ${artifact.name} (ID: ${artifact.id}, Size: ${artifact.size}, Expected Digest: ${artifact.digest})`);
|
||||
});
|
||||
}
|
||||
const downloadPromises = artifacts.map(artifact => ({
|
||||
name: artifact.name,
|
||||
promise: artifact_1.default.downloadArtifact(artifact.id, Object.assign(Object.assign({}, options), { path: isSingleArtifactDownload || inputs.mergeMultiple
|
||||
? resolvedPath
|
||||
: path.join(resolvedPath, artifact.name), expectedHash: artifact.digest }))
|
||||
}));
|
||||
const chunkedPromises = (0, exports.chunk)(downloadPromises, PARALLEL_DOWNLOADS);
|
||||
for (const chunk of chunkedPromises) {
|
||||
const chunkPromises = chunk.map(item => item.promise);
|
||||
const results = yield Promise.all(chunkPromises);
|
||||
const chunkedArtifacts = (0, exports.chunk)(artifacts, PARALLEL_DOWNLOADS);
|
||||
for (const chunk of chunkedArtifacts) {
|
||||
const chunkPromises = chunk.map(artifact => ({
|
||||
name: artifact.name,
|
||||
promise: artifact_1.default.downloadArtifact(artifact.id, Object.assign(Object.assign({}, options), { path: isSingleArtifactDownload || inputs.mergeMultiple
|
||||
? resolvedPath
|
||||
: path.join(resolvedPath, artifact.name), expectedHash: artifact.digest }))
|
||||
}));
|
||||
const results = yield Promise.all(chunkPromises.map(item => item.promise));
|
||||
for (let i = 0; i < results.length; i++) {
|
||||
const outcome = results[i];
|
||||
const artifactName = chunk[i].name;
|
||||
|
|
|
@ -169,22 +169,20 @@ export async function run(): Promise<void> {
|
|||
})
|
||||
}
|
||||
|
||||
const downloadPromises = artifacts.map(artifact => ({
|
||||
name: artifact.name,
|
||||
promise: artifactClient.downloadArtifact(artifact.id, {
|
||||
...options,
|
||||
path:
|
||||
isSingleArtifactDownload || inputs.mergeMultiple
|
||||
? resolvedPath
|
||||
: path.join(resolvedPath, artifact.name),
|
||||
expectedHash: artifact.digest
|
||||
})
|
||||
}))
|
||||
|
||||
const chunkedPromises = chunk(downloadPromises, PARALLEL_DOWNLOADS)
|
||||
for (const chunk of chunkedPromises) {
|
||||
const chunkPromises = chunk.map(item => item.promise)
|
||||
const results = await Promise.all(chunkPromises)
|
||||
const chunkedArtifacts = chunk(artifacts, PARALLEL_DOWNLOADS)
|
||||
for (const chunk of chunkedArtifacts) {
|
||||
const chunkPromises = chunk.map(artifact => ({
|
||||
name: artifact.name,
|
||||
promise: artifactClient.downloadArtifact(artifact.id, {
|
||||
...options,
|
||||
path:
|
||||
isSingleArtifactDownload || inputs.mergeMultiple
|
||||
? resolvedPath
|
||||
: path.join(resolvedPath, artifact.name),
|
||||
expectedHash: artifact.digest
|
||||
})
|
||||
}))
|
||||
const results = await Promise.all(chunkPromises.map(item => item.promise))
|
||||
|
||||
for (let i = 0; i < results.length; i++) {
|
||||
const outcome = results[i]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue