mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-13 04:58:45 +01:00
parent
be2b975095
commit
6126f49c2c
2 changed files with 8 additions and 7 deletions
6
dist/index.js
generated
vendored
6
dist/index.js
generated
vendored
|
|
@ -2439,11 +2439,11 @@ async function downloadArtifact(octokit, artifactId, fileName, token) {
|
|||
};
|
||||
const downloadStream = got_1.default.stream(req.url, { headers });
|
||||
const fileWriterStream = (0, fs_1.createWriteStream)(fileName);
|
||||
downloadStream.on('redirect', response => {
|
||||
downloadStream.on('redirect', (response) => {
|
||||
core.info(`Downloading ${response.headers.location}`);
|
||||
});
|
||||
downloadStream.on('downloadProgress', ({ transferred }) => {
|
||||
core.info(`Progress: ${transferred} B`);
|
||||
downloadStream.on('downloadProgress', (progress) => {
|
||||
core.info(`Progress: ${progress.transferred} B`);
|
||||
});
|
||||
await asyncStream(downloadStream, fileWriterStream);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,10 @@ import * as core from '@actions/core'
|
|||
import * as github from '@actions/github'
|
||||
import {GitHub} from '@actions/github/lib/utils'
|
||||
import type {PullRequest, WorkflowRunEvent} from '@octokit/webhooks-types'
|
||||
import {IncomingMessage} from 'http'
|
||||
import * as stream from 'stream'
|
||||
import {promisify} from 'util'
|
||||
import got from 'got'
|
||||
import got, {Progress} from 'got'
|
||||
const asyncStream = promisify(stream.pipeline)
|
||||
|
||||
export function getCheckRunContext(): {sha: string; runId: number} {
|
||||
|
|
@ -54,11 +55,11 @@ export async function downloadArtifact(
|
|||
const downloadStream = got.stream(req.url, {headers})
|
||||
const fileWriterStream = createWriteStream(fileName)
|
||||
|
||||
downloadStream.on('redirect', response => {
|
||||
downloadStream.on('redirect', (response: IncomingMessage) => {
|
||||
core.info(`Downloading ${response.headers.location}`)
|
||||
})
|
||||
downloadStream.on('downloadProgress', ({transferred}) => {
|
||||
core.info(`Progress: ${transferred} B`)
|
||||
downloadStream.on('downloadProgress', (progress: Progress) => {
|
||||
core.info(`Progress: ${progress.transferred} B`)
|
||||
})
|
||||
|
||||
await asyncStream(downloadStream, fileWriterStream)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue