Compare commits

..

No commits in common. "main" and "v1.3.3" have entirely different histories.
main ... v1.3.3

2 changed files with 22 additions and 36 deletions

29
dist/index.js vendored
View File

@ -48279,25 +48279,18 @@ async function uploadFiles(client, owner, repo, release_id, all_files, params) {
id: release_id, id: release_id,
}) })
// deleted old release attachment // deleted old release attachment
const will_deleted = new Set();
for (const filepath of all_files) { for (const filepath of all_files) {
will_deleted.add(external_path_.basename(filepath)); for (const attachment of attachments) {
if (params.md5sum) { let will_deleted = [external_path_.basename(filepath), `${external_path_.basename(filepath)}.md5`, `${external_path_.basename(filepath)}.sha256`]
will_deleted.add(`${external_path_.basename(filepath)}.md5`); if (will_deleted.includes(attachment.name)) {
} await client.repository.repoDeleteReleaseAttachment({
if (params.sha256sum) { owner: owner,
will_deleted.add(`${external_path_.basename(filepath)}.sha256`); repo: repo,
} id: release_id,
} attachmentId: attachment.id,
for (const attachment of attachments) { })
if (will_deleted.has(attachment.name)) { console.log(`Successfully deleted old release attachment ${attachment.name}`)
await client.repository.repoDeleteReleaseAttachment({ }
owner: owner,
repo: repo,
id: release_id,
attachmentId: attachment.id,
})
console.log(`Successfully deleted old release attachment ${attachment.name}`)
} }
} }
// upload new release attachment // upload new release attachment

29
main.js
View File

@ -143,25 +143,18 @@ async function uploadFiles(client, owner, repo, release_id, all_files, params) {
id: release_id, id: release_id,
}) })
// deleted old release attachment // deleted old release attachment
const will_deleted = new Set();
for (const filepath of all_files) { for (const filepath of all_files) {
will_deleted.add(path.basename(filepath)); for (const attachment of attachments) {
if (params.md5sum) { let will_deleted = [path.basename(filepath), `${path.basename(filepath)}.md5`, `${path.basename(filepath)}.sha256`]
will_deleted.add(`${path.basename(filepath)}.md5`); if (will_deleted.includes(attachment.name)) {
} await client.repository.repoDeleteReleaseAttachment({
if (params.sha256sum) { owner: owner,
will_deleted.add(`${path.basename(filepath)}.sha256`); repo: repo,
} id: release_id,
} attachmentId: attachment.id,
for (const attachment of attachments) { })
if (will_deleted.has(attachment.name)) { console.log(`Successfully deleted old release attachment ${attachment.name}`)
await client.repository.repoDeleteReleaseAttachment({ }
owner: owner,
repo: repo,
id: release_id,
attachmentId: attachment.id,
})
console.log(`Successfully deleted old release attachment ${attachment.name}`)
} }
} }
// upload new release attachment // upload new release attachment