@@ -3,9 +3,10 @@ import * as core from '@actions/core'
33import * as github from '@actions/github'
44import { GitHub } from '@actions/github/lib/utils'
55import type { PullRequest , WorkflowRunEvent } from '@octokit/webhooks-types'
6+ import { IncomingMessage } from 'http'
67import * as stream from 'stream'
78import { promisify } from 'util'
8- import got from 'got'
9+ import got , { Progress } from 'got'
910const asyncStream = promisify ( stream . pipeline )
1011
1112export function getCheckRunContext ( ) : { sha : string ; runId : number } {
@@ -54,11 +55,11 @@ export async function downloadArtifact(
5455 const downloadStream = got . stream ( req . url , { headers} )
5556 const fileWriterStream = createWriteStream ( fileName )
5657
57- downloadStream . on ( 'redirect' , response => {
58+ downloadStream . on ( 'redirect' , ( response : IncomingMessage ) => {
5859 core . info ( `Downloading ${ response . headers . location } ` )
5960 } )
60- downloadStream . on ( 'downloadProgress' , ( { transferred } ) => {
61- core . info ( `Progress: ${ transferred } B` )
61+ downloadStream . on ( 'downloadProgress' , ( progress : Progress ) => {
62+ core . info ( `Progress: ${ progress . transferred } B` )
6263 } )
6364
6465 await asyncStream ( downloadStream , fileWriterStream )
0 commit comments