Merge pull request #383 from GhadimiR/main

Bump artifact version, do digest check
This commit is contained in:
JoannaaKL
2025-03-18 16:31:00 +01:00
committed by GitHub
5 changed files with 436 additions and 59 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: "@actions/artifact"
version: 2.2.2
version: 2.3.2
type: npm
summary: Actions artifact lib
homepage: https://github.com/actions/toolkit/tree/main/packages/artifact
+400 -37
View File
File diff suppressed because one or more lines are too long
+9 -9
View File
@@ -1,15 +1,15 @@
{
"name": "download-artifact",
"version": "4.1.9",
"version": "4.2.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "download-artifact",
"version": "4.1.9",
"version": "4.2.0",
"license": "MIT",
"dependencies": {
"@actions/artifact": "^2.2.2",
"@actions/artifact": "^2.3.2",
"@actions/core": "^1.10.1",
"@actions/github": "^5.1.1",
"minimatch": "^9.0.3"
@@ -36,9 +36,9 @@
}
},
"node_modules/@actions/artifact": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-2.2.2.tgz",
"integrity": "sha512-UtS1kcINiPRkI3/hDKkO/XdrtKo89kn8s81J67QNBU6RRMWSSXrrfCCbQVThuxcdW2boOLv51NVCEKyo954A2A==",
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-2.3.2.tgz",
"integrity": "sha512-uX2Mr5KEPcwnzqa0Og9wOTEKIae6C/yx9P/m8bIglzCS5nZDkcQC/zRWjjoEsyVecL6oQpBx5BuqQj/yuVm0gw==",
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1",
@@ -6032,9 +6032,9 @@
"dev": true
},
"@actions/artifact": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-2.2.2.tgz",
"integrity": "sha512-UtS1kcINiPRkI3/hDKkO/XdrtKo89kn8s81J67QNBU6RRMWSSXrrfCCbQVThuxcdW2boOLv51NVCEKyo954A2A==",
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-2.3.2.tgz",
"integrity": "sha512-uX2Mr5KEPcwnzqa0Og9wOTEKIae6C/yx9P/m8bIglzCS5nZDkcQC/zRWjjoEsyVecL6oQpBx5BuqQj/yuVm0gw==",
"requires": {
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "download-artifact",
"version": "4.1.9",
"version": "4.2.0",
"description": "Download an Actions Artifact from a workflow run",
"main": "dist/index.js",
"scripts": {
@@ -28,7 +28,7 @@
},
"homepage": "https://github.com/actions/download-artifact#readme",
"dependencies": {
"@actions/artifact": "^2.2.2",
"@actions/artifact": "^2.3.2",
"@actions/core": "^1.10.1",
"@actions/github": "^5.1.1",
"minimatch": "^9.0.3"
+24 -10
View File
@@ -106,29 +106,43 @@ async function run(): Promise<void> {
core.info(`Preparing to download the following artifacts:`)
artifacts.forEach(artifact => {
core.info(
`- ${artifact.name} (ID: ${artifact.id}, Size: ${artifact.size})`
`- ${artifact.name} (ID: ${artifact.id}, Size: ${artifact.size}, Expected Digest: ${artifact.digest})`
)
})
}
const downloadPromises = artifacts.map(artifact =>
artifactClient.downloadArtifact(artifact.id, {
const downloadPromises = artifacts.map(artifact => ({
name: artifact.name,
promise: artifactClient.downloadArtifact(artifact.id, {
...options,
path:
isSingleArtifactDownload || inputs.mergeMultiple
? resolvedPath
: path.join(resolvedPath, artifact.name)
: path.join(resolvedPath, artifact.name),
expectedHash: artifact.digest
})
)
}))
const chunkedPromises = chunk(downloadPromises, PARALLEL_DOWNLOADS)
for (const chunk of chunkedPromises) {
await Promise.all(chunk)
}
const chunkPromises = chunk.map(item => item.promise)
const results = await Promise.all(chunkPromises)
core.info(`Total of ${artifacts.length} artifact(s) downloaded`)
core.setOutput(Outputs.DownloadPath, resolvedPath)
core.info('Download artifact has finished successfully')
for (let i = 0; i < results.length; i++) {
const outcome = results[i]
const artifactName = chunk[i].name
if (outcome.digestMismatch) {
core.warning(
`Artifact '${artifactName}' digest validation failed. Please verify the integrity of the artifact.`
)
}
}
core.info(`Total of ${artifacts.length} artifact(s) downloaded`)
core.setOutput(Outputs.DownloadPath, resolvedPath)
core.info('Download artifact has finished successfully')
}
}
run().catch(err =>