Skip to content

Commit a2229d2

Browse files
committed
print artifact filename and size
1 parent 39afbb6 commit a2229d2

14 files changed

Lines changed: 1281 additions & 3 deletions

main.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const core = require('@actions/core')
22
const github = require('@actions/github')
33
const AdmZip = require('adm-zip')
4+
const filesize = require('filesize')
45

56
async function main() {
67
try {
@@ -85,13 +86,15 @@ async function main() {
8586

8687
console.log("==> Artifact:", artifact.id)
8788

88-
const format = "zip"
89+
const size = filesize(artifact.size_in_bytes, { base: 10 })
90+
91+
console.log("==> Downloading:", name + ".zip", `(${size})`)
8992

9093
const zip = await client.actions.downloadArtifact({
9194
owner: owner,
9295
repo: repo,
9396
artifact_id: artifact.id,
94-
archive_format: format,
97+
archive_format: "zip",
9598
})
9699

97100
const adm = new AdmZip(Buffer.from(zip.data))

node_modules/filesize/CHANGELOG.md

Lines changed: 585 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/filesize/LICENSE

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/filesize/README.md

Lines changed: 92 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/filesize/filesize.d.ts

Lines changed: 103 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)