From ea07b9e68aad6a54b03502eaba5c1e34ffbf158f Mon Sep 17 00:00:00 2001 From: Johannes Spangenberg Date: Sat, 4 May 2024 05:15:30 +0200 Subject: [PATCH] Fix problematic retransmission of authentication token The retransmission of the authentication token to the server providing the artifact caused the following errors when using Artifacts v4: HTTPError: Response code 400 (Authentication information is not given in the correct format. Check the value of Authorization header.) It looks like the service serving the artifacts does not expect the authentication header, and therefore complaines about inproper use of the authentication header. --- dist/index.js | 2 +- src/utils/github-utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index dee44688..a01287af 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2168,7 +2168,7 @@ function downloadArtifact(octokit, artifactId, fileName, token) { if (typeof url !== 'string') { throw new Error(`Location header has unexpected value: ${url}`); } - const downloadStream = got_1.default.stream(url, { headers }); + const downloadStream = got_1.default.stream(url); const fileWriterStream = (0, fs_1.createWriteStream)(fileName); core.info(`Downloading ${url}`); downloadStream.on('downloadProgress', ({ transferred }) => { diff --git a/src/utils/github-utils.ts b/src/utils/github-utils.ts index 1d4add7d..56e6c88f 100644 --- a/src/utils/github-utils.ts +++ b/src/utils/github-utils.ts @@ -70,7 +70,7 @@ export async function downloadArtifact( throw new Error(`Location header has unexpected value: ${url}`) } - const downloadStream = got.stream(url, {headers}) + const downloadStream = got.stream(url) const fileWriterStream = createWriteStream(fileName) core.info(`Downloading ${url}`)