diff --git a/dist/merge/index.js b/dist/merge/index.js index bf6f202..b12693d 100644 --- a/dist/merge/index.js +++ b/dist/merge/index.js @@ -131863,7 +131863,15 @@ function getInputs() { async function upload_artifact_uploadArtifact(artifactName, filesToUpload, rootDirectory, options) { const uploadResponse = await lib_artifact.uploadArtifact(artifactName, filesToUpload, rootDirectory, options); - info(`Artifact ${artifactName} has been successfully uploaded! Final size is ${uploadResponse.size} bytes. Artifact ID is ${uploadResponse.id}`); + const size = uploadResponse.size; + const displaySize = size === undefined + ? 'unknown' + : size >= 1024 * 1024 + ? `${(size / (1024 * 1024)).toFixed(2)} MB` + : size >= 1024 + ? `${(size / 1024).toFixed(2)} KB` + : `${size} bytes`; + info(`Artifact ${artifactName} has been successfully uploaded! Final size is ${displaySize}. Artifact ID is ${uploadResponse.id}`); setOutput('artifact-id', uploadResponse.id); setOutput('artifact-digest', uploadResponse.digest); const repository = github_context.repo; diff --git a/dist/upload/index.js b/dist/upload/index.js index a36d775..2411247 100644 --- a/dist/upload/index.js +++ b/dist/upload/index.js @@ -130546,7 +130546,15 @@ function getInputs() { async function upload_artifact_uploadArtifact(artifactName, filesToUpload, rootDirectory, options) { const uploadResponse = await artifact.uploadArtifact(artifactName, filesToUpload, rootDirectory, options); - info(`Artifact ${artifactName} has been successfully uploaded! Final size is ${uploadResponse.size} bytes. Artifact ID is ${uploadResponse.id}`); + const size = uploadResponse.size; + const displaySize = size === undefined + ? 'unknown' + : size >= 1024 * 1024 + ? `${(size / (1024 * 1024)).toFixed(2)} MB` + : size >= 1024 + ? `${(size / 1024).toFixed(2)} KB` + : `${size} bytes`; + info(`Artifact ${artifactName} has been successfully uploaded! Final size is ${displaySize}. Artifact ID is ${uploadResponse.id}`); setOutput('artifact-id', uploadResponse.id); setOutput('artifact-digest', uploadResponse.digest); const repository = github_context.repo; diff --git a/src/shared/upload-artifact.ts b/src/shared/upload-artifact.ts index 379a39e..bb10bc8 100644 --- a/src/shared/upload-artifact.ts +++ b/src/shared/upload-artifact.ts @@ -15,8 +15,17 @@ export async function uploadArtifact( options ) + const size = uploadResponse.size + const displaySize = + size === undefined + ? 'unknown' + : size >= 1024 * 1024 + ? `${(size / (1024 * 1024)).toFixed(2)} MB` + : size >= 1024 + ? `${(size / 1024).toFixed(2)} KB` + : `${size} bytes` core.info( - `Artifact ${artifactName} has been successfully uploaded! Final size is ${uploadResponse.size} bytes. Artifact ID is ${uploadResponse.id}` + `Artifact ${artifactName} has been successfully uploaded! Final size is ${displaySize}. Artifact ID is ${uploadResponse.id}` ) core.setOutput('artifact-id', uploadResponse.id) core.setOutput('artifact-digest', uploadResponse.digest)