mirror of
https://github.com/dorny/test-reporter.git
synced 2026-02-01 10:55:23 -08:00
Show artifact download progress
This commit is contained in:
@@ -33,6 +33,7 @@ export async function downloadArtifact(
|
||||
octokit: InstanceType<typeof GitHub>,
|
||||
artifactId: number,
|
||||
fileName: string,
|
||||
size: number,
|
||||
token: string
|
||||
): Promise<void> {
|
||||
core.startGroup(`Downloading artifact ${fileName}`)
|
||||
@@ -72,9 +73,9 @@ export async function downloadArtifact(
|
||||
const fileWriterStream = createWriteStream(fileName)
|
||||
|
||||
core.info(`Downloading ${url}`)
|
||||
downloadStream.on('downloadProgress', ({transferred, total, percent}) => {
|
||||
const percentage = Math.round(percent * 100)
|
||||
core.info(`Progress: ${transferred}/${total} (${percentage}%)`)
|
||||
downloadStream.on('downloadProgress', ({transferred}) => {
|
||||
const percentage = Math.round(transferred / size * 100)
|
||||
core.info(`Progress: ${transferred}/${size} (${percentage}%)`)
|
||||
})
|
||||
await asyncStream(downloadStream, fileWriterStream)
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user