You've already forked gitea-release-action
mirror of
https://gitea.com/actions/gitea-release-action.git
synced 2025-07-31 14:27:11 +07:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
fe8e032280 | |||
3dbdc45d61 | |||
f66c1c98f1 |
@ -10,6 +10,9 @@ inputs:
|
|||||||
body:
|
body:
|
||||||
description: "Note-worthy description of changes in release"
|
description: "Note-worthy description of changes in release"
|
||||||
required: false
|
required: false
|
||||||
|
body_path:
|
||||||
|
description: "Path to load description of changes in this release"
|
||||||
|
required: false
|
||||||
name:
|
name:
|
||||||
description: "Gives the release a custom name. Defaults to tag name"
|
description: "Gives the release a custom name. Defaults to tag name"
|
||||||
required: false
|
required: false
|
||||||
|
29
dist/index.js
vendored
29
dist/index.js
vendored
@ -48279,18 +48279,25 @@ 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) {
|
||||||
for (const attachment of attachments) {
|
will_deleted.add(external_path_.basename(filepath));
|
||||||
let will_deleted = [external_path_.basename(filepath), `${external_path_.basename(filepath)}.md5`, `${external_path_.basename(filepath)}.sha256`]
|
if (params.md5sum) {
|
||||||
if (will_deleted.includes(attachment.name)) {
|
will_deleted.add(`${external_path_.basename(filepath)}.md5`);
|
||||||
await client.repository.repoDeleteReleaseAttachment({
|
}
|
||||||
owner: owner,
|
if (params.sha256sum) {
|
||||||
repo: repo,
|
will_deleted.add(`${external_path_.basename(filepath)}.sha256`);
|
||||||
id: release_id,
|
}
|
||||||
attachmentId: attachment.id,
|
}
|
||||||
})
|
for (const attachment of attachments) {
|
||||||
console.log(`Successfully deleted old release attachment ${attachment.name}`)
|
if (will_deleted.has(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
29
main.js
@ -143,18 +143,25 @@ 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) {
|
||||||
for (const attachment of attachments) {
|
will_deleted.add(path.basename(filepath));
|
||||||
let will_deleted = [path.basename(filepath), `${path.basename(filepath)}.md5`, `${path.basename(filepath)}.sha256`]
|
if (params.md5sum) {
|
||||||
if (will_deleted.includes(attachment.name)) {
|
will_deleted.add(`${path.basename(filepath)}.md5`);
|
||||||
await client.repository.repoDeleteReleaseAttachment({
|
}
|
||||||
owner: owner,
|
if (params.sha256sum) {
|
||||||
repo: repo,
|
will_deleted.add(`${path.basename(filepath)}.sha256`);
|
||||||
id: release_id,
|
}
|
||||||
attachmentId: attachment.id,
|
}
|
||||||
})
|
for (const attachment of attachments) {
|
||||||
console.log(`Successfully deleted old release attachment ${attachment.name}`)
|
if (will_deleted.has(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
|
||||||
|
Reference in New Issue
Block a user