From ed25d4d91270b5f63935fb815ac69f2234ef3aa2 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Thu, 30 Nov 2023 22:06:26 -0500 Subject: [PATCH] more debug logs --- dist/index.js | 10 +++++++--- src/download-artifact.ts | 8 ++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dist/index.js b/dist/index.js index 195fcc9..6ad7d95 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8331,7 +8331,7 @@ class ArtifactHttpClient { request(service, method, contentType, data) { return __awaiter(this, void 0, void 0, function* () { const url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; - (0, core_1.debug)(`Requesting: ${url}`); + (0, core_1.debug)(`[Request] ${method} ${url}`); const headers = { 'Content-Type': contentType }; @@ -8354,6 +8354,8 @@ class ArtifactHttpClient { try { const response = yield operation(); const statusCode = response.message.statusCode; + (0, core_1.debug)(`[Response] ${response.message.statusCode}`); + (0, core_1.debug)(JSON.stringify(response.message.headers, null, 2)); if (this.isSuccessStatusCode(statusCode)) { return response; } @@ -119373,7 +119375,8 @@ function run() { if (!targetArtifact) { throw new Error(`Artifact '${inputs.name}' not found`); } - core.debug(`Found named artifact '${inputs.name}' (ID: ${targetArtifact.id}, Size: ${targetArtifact.size})`); + core.debug('Found named artifact:'); + core.debug(JSON.stringify(targetArtifact, null, 2)); artifacts = [targetArtifact]; } else { @@ -119381,7 +119384,8 @@ function run() { if (listArtifactResponse.artifacts.length === 0) { throw new Error(`No artifacts found for run '${inputs.runID}' in '${inputs.repository}'`); } - core.debug(`Found ${listArtifactResponse.artifacts.length} artifacts`); + core.debug(`Found ${listArtifactResponse.artifacts.length} artifacts:`); + core.debug(JSON.stringify(listArtifactResponse, null, 2)); artifacts = listArtifactResponse.artifacts; } const downloadPromises = artifacts.map(artifact => artifactClient.downloadArtifact(artifact.id, Object.assign(Object.assign({}, options), { path: path.join(resolvedPath, artifact.name) }))); diff --git a/src/download-artifact.ts b/src/download-artifact.ts index 4217393..67edb72 100644 --- a/src/download-artifact.ts +++ b/src/download-artifact.ts @@ -63,9 +63,8 @@ async function run(): Promise { throw new Error(`Artifact '${inputs.name}' not found`) } - core.debug( - `Found named artifact '${inputs.name}' (ID: ${targetArtifact.id}, Size: ${targetArtifact.size})` - ) + core.debug('Found named artifact:') + core.debug(JSON.stringify(targetArtifact, null, 2)) artifacts = [targetArtifact] } else { @@ -77,7 +76,8 @@ async function run(): Promise { ) } - core.debug(`Found ${listArtifactResponse.artifacts.length} artifacts`) + core.debug(`Found ${listArtifactResponse.artifacts.length} artifacts:`) + core.debug(JSON.stringify(listArtifactResponse, null, 2)) artifacts = listArtifactResponse.artifacts }