Skip to content

Commit

Permalink
Removed progress percentage as there is no way to deduce content length
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Dorner committed Feb 15, 2021
1 parent 1ae86a1 commit e356ffe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/input-providers/artifact-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class ArtifactProvider implements InputProvider {

for (const art of artifacts) {
const fileName = `${art.name}.zip`
await downloadArtifact(this.octokit, art.id, fileName, art.size_in_bytes, this.token)
await downloadArtifact(this.octokit, art.id, fileName, this.token)
core.startGroup(`Reading archive ${fileName}`)
try {
const reportName = this.getReportName(art.name)
Expand Down
4 changes: 1 addition & 3 deletions src/utils/github-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export async function downloadArtifact(
octokit: InstanceType<typeof GitHub>,
artifactId: number,
fileName: string,
size: number,
token: string
): Promise<void> {
core.startGroup(`Downloading artifact ${fileName}`)
Expand Down Expand Up @@ -74,8 +73,7 @@ export async function downloadArtifact(

core.info(`Downloading ${url}`)
downloadStream.on('downloadProgress', ({transferred}) => {
const percentage = Math.round((transferred / size) * 100)
core.info(`Progress: ${transferred}/${size} (${percentage}%)`)
core.info(`Progress: ${transferred} B`)
})
await asyncStream(downloadStream, fileWriterStream)
} finally {
Expand Down

0 comments on commit e356ffe

Please sign in to comment.