From 1e8f8cc30ecddcc56f0a1e20651a632183f934c9 Mon Sep 17 00:00:00 2001 From: Akkuman Date: Sat, 2 Dec 2023 19:09:42 +0800 Subject: [PATCH] fix: upload attachment --- dist/index.js | 20 ++++++++++---------- main.js | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/dist/index.js b/dist/index.js index 28ddcb0..55a0f98 100644 --- a/dist/index.js +++ b/dist/index.js @@ -41001,17 +41001,17 @@ async function uploadFiles(client, owner, repo, release_id, all_files) { }) console.log(`Successfully deleted old release attachment ${attachment.name}`) } - const content = external_fs_.readFileSync(filepath); - const blob = new external_buffer_.Blob([content]); - await client.repository.repoCreateReleaseAttachment({ - owner: owner, - repo: repo, - id: release_id, - attachment: blob, - name: external_path_.basename(filepath), - }) - console.log(`Successfully uploaded release attachment ${filepath}`) } + const content = external_fs_.readFileSync(filepath); + const blob = new external_buffer_.Blob([content]); + await client.repository.repoCreateReleaseAttachment({ + owner: owner, + repo: repo, + id: release_id, + attachment: blob, + name: external_path_.basename(filepath), + }) + console.log(`Successfully uploaded release attachment ${filepath}`) } } diff --git a/main.js b/main.js index b868518..a69fcb0 100644 --- a/main.js +++ b/main.js @@ -114,17 +114,17 @@ async function uploadFiles(client, owner, repo, release_id, all_files) { }) console.log(`Successfully deleted old release attachment ${attachment.name}`) } - const content = fs.readFileSync(filepath); - const blob = new Blob([content]); - await client.repository.repoCreateReleaseAttachment({ - owner: owner, - repo: repo, - id: release_id, - attachment: blob, - name: path.basename(filepath), - }) - console.log(`Successfully uploaded release attachment ${filepath}`) } + const content = fs.readFileSync(filepath); + const blob = new Blob([content]); + await client.repository.repoCreateReleaseAttachment({ + owner: owner, + repo: repo, + id: release_id, + attachment: blob, + name: path.basename(filepath), + }) + console.log(`Successfully uploaded release attachment ${filepath}`) } }