From 1e10fa415cd17802162a65f784713fd24e8ddd5a Mon Sep 17 00:00:00 2001 From: Yang Cao Date: Thu, 3 Dec 2020 12:40:37 -0500 Subject: [PATCH] Add some debugging statements --- src/internal/download-http-client.ts | 8 ++++++++ src/internal/utils.ts | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/internal/download-http-client.ts b/src/internal/download-http-client.ts index 201a5f7..10b59dd 100644 --- a/src/internal/download-http-client.ts +++ b/src/internal/download-http-client.ts @@ -213,6 +213,11 @@ export class DownloadHttpClient { !received || process.env['ACTIONS_ARTIFACT_SKIP_DOWNLOAD_VALIDATION'] ) { + if (process.env['ACTIONS_ARTIFACT_SKIP_DOWNLOAD_VALIDATION']) { + core.info( + 'Skipping download validation since environment variable is set' + ) + } return true } @@ -231,6 +236,9 @@ export class DownloadHttpClient { let response: IHttpClientResponse try { response = await makeDownloadRequest() + if (core.isDebug()) { + displayHttpDiagnostics(response) + } } catch (error) { // if an error is caught, it is usually indicative of a timeout so retry the download core.info('An error occurred while attempting to download a file') diff --git a/src/internal/utils.ts b/src/internal/utils.ts index ea20364..2f4f2f4 100644 --- a/src/internal/utils.ts +++ b/src/internal/utils.ts @@ -305,6 +305,9 @@ export async function createEmptyFilesForArtifact( export async function getFileSize(filePath: string): Promise { const stats = await fs.stat(filePath) + debug( + `${filePath} size:(${stats.size}) blksize:(${stats.blksize}) blocks:(${stats.blocks})` + ) return stats.size }