From f74645623ddc75bdb6e4b197b5d40bc712dd890b Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Mar 2024 10:01:31 +0000 Subject: [PATCH] Update bundle based on commit 6a1f2b6014d4f8d3bce913b5ccf3001e997d17c5 --- dist/main.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/dist/main.js b/dist/main.js index 6f912315..6110786b 100644 --- a/dist/main.js +++ b/dist/main.js @@ -477,14 +477,11 @@ try { requestHeaders.append("Content-Type", "multipart/form-data"); const requestForm = new FormData(); for (let index = 0; index < files.length; index += 1) { - // const fileFullPath = pathJoin(ghactionsWorkspaceDirectory, files[index]); attachments.push({ - // "filename": pathBaseName(fileFullPath), - "filename": pathBaseName(files[index]), - "id": index + filename: pathBaseName(files[index]), + id: index }); - // requestForm.append(`files[${filesIndex}]`, fsCreateReadStream(fileFullPath)); - requestForm.append(`files[${index}]`, new Blob([await fsReadFile(files[index])])); + requestForm.append(`files[${index}]`, new Blob([await fsReadFile(files[index])]), pathBaseName(files[index])); } requestForm.append("attachments", JSON.stringify(attachments)); requestForm.append("payload_json", requestPayloadStringify); @@ -494,7 +491,7 @@ try { requestHeaders.append("Content-Type", "application/json"); return requestPayloadStringify; default: - throw new Error(`${method} is not a valid method!`); + throw new Error(`\`${method}\` is not a valid method!`); } })(); console.log(`Post network request to Discord.`);